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
205
Capturing object associate with UltraWinToolbars ComboBoxTool
posted

Hello.

I have a ComboBoxTool on my UltraWinToolbar. 

I am populating the list at runtime like this:

 

public void addDevice(object newDevice)
        {
            deviceComboBox.ValueList.ValueListItems.Add(newDevice, newDevice.ToString());
        }

 

What I need to do is get that 'newDevice' object out when the user selects a new list member in the comboBox. 

I am currently using the ToolValueChanged event to hopefully find a reference to the object associated with this new selection.  Is that object actually in the ToolEventArgs that the event provides, or am I on the wrong track.

 

Thanks!

Parents
  • 205
    posted

    UPDATE:

    I found A solution...seems a little longwinded, but maybe its the most direct way...

    void OnDeviceComboBoxValueChanged(object sender, ToolEventArgs e)
            {
                deviceSelected(this, new DeviceEventArgs((DeviceName)deviceComboBox.ValueList.ValueListItems[deviceComboBox.ValueList.SelectedIndex].DataValue));
            }

Reply Children
No Data