Showing posts with label non-selectable. Show all posts
Showing posts with label non-selectable. Show all posts

Saturday, March 24, 2012

Dropdownlist with non-selectable ListItems

Is it possible to use one of the toolkit controls to create a Dropdownlist containing ListItems that are selectable andnon-selectable? (i.e. hovering your mouse over thenon-selectable items doesn't highlight them and clicking on them does nothing - they are just there to group ListItems together).

Consider these 8 ListItems in a DropdownList:

-- Fruit --

Apple

Orange

Banana

-- Vegetables --

Carrot

Onion

Garlic

Using this hypothetical control, the ListItems "--Fruit--" and "--Vegetables--" would benon-selectable (and just there for grouping). All other listitems would be selectable.

How can I do this?

Hi,

Currently, this feature isn't available, you may submit a feature requesthere if you don't plan to implement it yourself.

Dropdownlist with non-selectable items

Hi all,

I've been using AJAX and the Toolkit. I don't know much about authoring my own controls, so I'll need a lot of help here. Basically what I want is a dropdownlist where some of the items in the list are non-selectable. I can then use the non-selectable items to group selectable items together. For example:

Imagine the following items in a Dropdownlist:

-- Fruit --

Apple

Orange

Banana

-- Vegetables --

Carrot

Onion

Garlic

I want the items "Fruit" and "Vegetables" should be non-selectable. I could always do this with two cascading dropdown lists but this is a more user-friendly solution (less controls, less clicks, etc). It was also requested by my clients.

You can check ,

DropDownList.SelectedIndex property for perticauler position value.

If it is --Fruit-- or --Vegetables-- try to re-set index of dropdownlist.


I suggested that to the clients butthey want these items to be static - i.e. don't even give the user the chance to select them.

In other words, when you hover your mouse over --Fruit-- or --Vegetable-- ListItems, theyshouldn'tbe highlighted or selectable at all. If the user tries to click on one of them, the DropDownList should just continue to be expanded as if nothing happened.