Adding attributes to items in a dropdown list

J

Joe Molloy

Hey again,

Anybody have any ideas about how I would go about adding attributes to the
listitems in a databound dropdownlist?

Asp.net debugger has kindly informed me that dropdown list is not a
collection so that 'for each listitem in dropdownlist' style code won't
work.

Joe
 
J

Joe Molloy

That kinda takes from the convenience of the databinding - I don't want to
have to loop through and add values - does anyone know off the top of their
heads is there an onItemCreate method like that for datalists and datagrids?

Joe
 
N

nfedin

There is an event fired by DataGrids called ItemDataBound. You might
be able to catch this event and then add your attribute there.

Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,839
Latest member
MartinaBur

Latest Threads

Top