Extended DropDownList Select Item Progammatically

Dec 11, 2008 at 6:52 AM
I'm having trouble selecting an item programtically using the ExtendedDropDownList control.  For a normal dropdownlist control you would use the following code:
ddl.items.FindByValue("1").selected = true;

I see the ExtendedDropDownList has ExtendedItems, however the FindByText and FindByValue methods are not to be found. Are their any known work arounds for this?

Thank you! Easton
Dec 11, 2008 at 8:16 AM
Easton, the same code as the one you posted for the DropDownList should also work with ExtendedDropDownList...
Dec 11, 2008 at 8:32 AM

Thank you for your quick reply! The intellisense of the entendeddropdownlist control doesn't seem to have an 'Items' available to consume. Am i smoking crack? And I cannot find the FindByText or FindByValue methods anywhere. I'm using the latest release.
Dec 11, 2008 at 5:39 PM

I tried the following code on the demos: 
this.ddl.Items.FindByValue("23").Selected = true;
and worked as expected.

Perhaps the reason you don't have the Items collection in the autocomplete is we override the property and add it the following attributes:

[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

Dec 11, 2008 at 5:52 PM
Ah, yes. That works great! I'm not sure why it's set to not be browsable, but it compiles and executes just fine. Thank you very much for your help an insight.

This is a great project, keep up the good work!

- Easton