Search code examples
winformsvisual-studio-2013devexpress

BarEditItem1, what is the code to access to a combox item


In my form I have a Barmanager, in which I have a comboboxedit1. I want to know how to access to the selected item of the baredititem1 (combobox). In the normal combobox it is:

dim q =combobox1.selecteditem

but I can't do the same in a baredititem1 wgich is placed in a barmanager.


Solution

  • You can grab the current selected value using the barEditItem1.EditValue property, or while the editor is activated, you can access the current editor instance by BarManager.ActiveEditor property, which you should cast to ComboBoxEdit in your case. You can read about this more in the documentation, where they explain why you cannot access the concrete editor anytime you want.