Dropdownlist headings

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
 
E

Eirik Eldorsen

Hi

Just use the following code:

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

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,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top