Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1825
Tool - combobox ?
posted

Morning,

How does one set the combobox to display one of the values in the list? [vb.net]

Usually I would use combobox.selectedindex = combobox.findexactstring("Value", -1).

Can't find anyting like this in the object. I have the valuelist filled with my items. Filling in both Datavalue and Displaytext for the itemvalue.

I can see each item in the dropdownlist of the combobox.

I get my value I want to find/display from a dataview cell. text value.

Any help would be most appreciated.

Thanks

Deasun

  • 4165
    Offline posted

    If you just set the .Text to something it should be selected if it is in the valuelist.

    When dealing with combox with the toolbars usually you have to cast it to  ComboBoxTool, sort of like

    ComboBoxTool c = (ComboBoxTool)e.Tool;

    c.Text = "some item";

    or,

    c.SelectedItem = c.ValueList.FindExactString or c.FindByDataValue

    Hope that helps.