Adding attributes to items in a dropdown list

  • Thread starter Thread starter Joe Molloy
  • Start date Start date
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
 
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
 
There is an event fired by DataGrids called ItemDataBound. You might
be able to catch this event and then add your attribute there.

Neil
 
Back
Top