I have a WinDropDown control (which appears to be a specialized UltraGrid control) that is databound to a BindingList<ObjectDetails> collection.
It is my impression that if I want to take action when a user selects an item from the collection, I need to handle the RowSelectedEventHandler.
The question I have is, once in that handler, how do I get the ObjectDetail object that was selected?
Sam
The UltraDropDown is not a standalone control, it only works as a dropdown in a grid cell. So if you are using the UltraDropDown, you probably want to trap the CellChange event of the grid, not the RowSelected event of the dropdown.
For a standalone dropdown control, you would use UltraCombo. In which case, you probably want to use the ValueChanged event and examine the Value property of the control, rather than RowSelected, because RowSelected will not fire if the user changes the value by typing into the control.
You are correct, I am using the UltraCombo. How do I go about getting the selected object from it? In mikrokom's example (which I am assuming does not apply because this is an UltraCombo, not the WinDropDown) he assumed that the object was holding a string. It isn't, it is holding an object called "Class Details", so it is like this:
List<ClassDetails> listToDisplay = GetClassDetailsList();ultraComboCtrl.DataSource = listToDisplay;
The goal is once a user selects a row, to get back the ClassDetail that was selected.
Hi Sam,
All you need to do is get the Value property of the control, then.
Oops, I responded too quickly before I realized you are binding to a list of objects.
You have two options here. One of them is described here:
Grid of complex objects and ValueList columns - Infragistics Community
The other option is described here:
Binding Problem to an UltraDropdown where the Grid Colum is an Entity - Infragistics Community
Ok, I have had some more time to look over both of those poses and they simply don't make sense to me. In the first one you said:
"If you just want a single dropdown list without multiple columns, then you should not use an UltraDropDown,but rather use a ValueList."
I don't see a ValueList control anywhere, for that matter, the only control I see that starts with a V is the UltraValidator.
And with regards to the second link, I don't have a clue as to what the OP is asking so your response is of no value to me, makes me feel like I am on Jeopardy :)
I took a few minutes and created the attach project that has both the UltraCombo which is databound and the MS ComboBox. I implemented the SelectedIndexChanged on the MS ComboBox to deminstrate exactly what I need to do. I am hoping that you all can add to the project to make your UltraDropDown work the same way or replace it with the ValueList and implement that for me so I have a live example to look at!
I figured out the issue, I was using the wrong control. I had been using the UltraCombo when I should have been using the UltraComboEditor.
The BindableValueList is in Infragistics.Win. That assembly has a dependency on Infragistics.Shared, so you will need both.
I need to put BindableValueList into an assembly that does not currently have any of your controls, which assembly do I need to reference?