Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Dropdownlist headings

Reply
Thread Tools

Dropdownlist headings

 
 
jack-e
Guest
Posts: n/a
 
      07-08-2005
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

 
Reply With Quote
 
 
 
 
Eirik Eldorsen
Guest
Posts: n/a
 
      07-08-2005
Hi

Just use the following code:

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

--
Eirik Eldorsen


"jack-e" <(E-Mail Removed)> skrev i melding
news:(E-Mail Removed) oups.com...
> 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
>



 
Reply With Quote
 
 
 
 
jack-e
Guest
Posts: n/a
 
      07-08-2005
how do i disable the item so the user can't select it?

 
Reply With Quote
 
Mantorok
Guest
Posts: n/a
 
      07-08-2005

"jack-e" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> how do i disable the item so the user can't select it?
>


ListItem li = new ListItem("Text", "Value");
li.Enabled = false;

Kev


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Headings in the DataGrid Web Control =?Utf-8?B?QWxhbiBMYW1iZXJ0?= ASP .Net 10 03-05-2006 01:07 AM
Dropdownlist headings jack-e ASP .Net Web Controls 3 07-08-2005 03:00 PM
Code to export html table (.RenderControl) doesn't like sort headings? Kathy Burke ASP .Net 2 11-11-2003 11:23 PM
Re: Datagrid headings Saravana ASP .Net 1 07-23-2003 01:39 PM
Sorting in a DataGrid with no headings Tracey ASP .Net 0 07-23-2003 12:37 PM



Advertisments