Dropdownlist headings

  • Thread starter Thread starter jack-e
  • Start date Start date
J

jack-e

Hi,

Senario: i have a dropdownlist which is bound to a lookup table.

question: how do i insert headings into the dropdownlist which cannot
be selected, without altering the selected values of the other bound
items?

Thanks.

Jack
 
Hi

Just use the following code:

ListItem item = new ListItem("Header", "somevalue");
ddlCategory.Items.Insert(0, item);
// OR //
ddlCategory.Items.Insert(0, "Header");
 
Back
Top