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
821
Selecting Item in Combobox-Tool via Code
posted

 Hello Dear

Im searching a way to select a ComboboxTools' Valuelistitem in the code.  I tried the following methods, but nothing happens and the ValueList.SelectedItem keeps null

((ComboBoxTool)toolbarManager.Tools["tcmdToolkey"]).ValueList.SelectedItem = ((ComboBoxTool)toolbarManager.Tools["tcmdToolkey"]).ValueList.ValueListItems[0]; <-- This list contains items

 and

 ((ComboBoxTool)toolbarManager.Tools["tcmdToolkey"]).ValueList.SelectedIndex = 1;

Can you help me please?

Greetings 

  • 44743
    Verified Answer
    posted

    Try setting the Value property of the ComboBoxTool to the data contained in the value list item you want to select. The ComboBoxTool only syncs its value with the ValueList's selected item when it is in edit mode.