I need to get selected valuelistitem from dropdown that is assigned as editor to the cell. My combo has items with same texts/values and additional information is stored in value list item tags.
I used two approaches, both failed:
1. Using AfterCellListCloseUp:
UltraComboEditor cmb = e.Cell.EditorComponentResolved as UltraComboEditor;
selected item/selected index are null and -1. is there a way to get exact value list item that was clicked (other than searching by cell.text)?
2. using cell change to trigger .PerformAction(UltraGridAction.ExitEditMode), and in AfterCellUpdate i tried the same - again selected item, selected index are no use.
Any other way to get valuelistitem?
You cannot get the SelectedIndex or item from the Combo. The Combo services the entire column, so it cannot possibly return a meaningful value. You have to get whatever information you need from the cell using Text or Value property of the cell.
If you need to find the matching item on the list given the Value or Text or the cell, then you can use the cell.ValueListResolved.GetText or GetValue methods.
Hi,
Please let us know if you have additional questions regarding the solution given by Mike.