Dropdownlist headings

Discussion in 'ASP .Net' started by jack-e, Jul 8, 2005.

  1. jack-e

    jack-e Guest

    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
     
    jack-e, Jul 8, 2005
    #1
    1. Advertising

  2. 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" <> skrev i melding
    news:...
    > 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
    >
     
    Eirik Eldorsen, Jul 8, 2005
    #2
    1. Advertising

  3. jack-e

    jack-e Guest

    how do i disable the item so the user can't select it?
     
    jack-e, Jul 8, 2005
    #3
  4. jack-e

    Mantorok Guest

    "jack-e" <> wrote in message
    news:...
    > how do i disable the item so the user can't select it?
    >


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

    Kev
     
    Mantorok, Jul 8, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Saravana

    Re: Datagrid headings

    Saravana, Jul 22, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    473
    Saravana
    Jul 23, 2003
  2. Tracey
    Replies:
    0
    Views:
    373
    Tracey
    Jul 23, 2003
  3. Kathy Burke
    Replies:
    2
    Views:
    3,774
    Kathy Burke
    Nov 11, 2003
  4. =?Utf-8?B?QWxhbiBMYW1iZXJ0?=

    Headings in the DataGrid Web Control

    =?Utf-8?B?QWxhbiBMYW1iZXJ0?=, Sep 29, 2004, in forum: ASP .Net
    Replies:
    10
    Views:
    759
    =?Utf-8?B?Y29vbHRlY2g3Nw==?=
    Mar 5, 2006
  5. jack-e

    Dropdownlist headings

    jack-e, Jul 8, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    130
    Mantorok
    Jul 8, 2005
Loading...

Share This Page