This post is kind of similar to a previous posting (http://forums.infragistics.com/forums/p/3391/19040.aspx), which was about UltraDropDowns, and was never 100% answered.
Anyway, what I want is to be able to run some code as soon as the user selects an option in the UltraCombo. I have tried a few events, none of which are quite there:
AfterCloseUp - Fires no matter how the combo is closed up, by selecting an option, or just by closing it without selecting an option.
RowSelected - Fires every time the user moves from row to row within the combo, no matter if they selected an option or not.
ValueChanged - Fires as the user is typing an option in (when auto-complete kicks in).
AfterCloseUp looks like it would be the perfect place, if only I had a way of knowing if it was closed up because the user selected an option or if the user just closed it without selecting anything.
Anyone have any ideas?
Hello fweeee,
You are right - you could use the 'AfterCloseUp' event. You could check in it if the left mouse button is clicked and if this was done on a cell in the WinCombo control.
Below is a my code sample:
private void ultraCombo1_AfterCloseUp(object sender, EventArgs e) { if (mouseCaptured .Button == MouseButtons.Left && ((Infragistics.Win.ControlUIElementBase)(ultraCombo1.DisplayLayout.UIElement)).LastElementEntered != null && ((Infragistics.Win.ControlUIElementBase)(ultraCombo1.DisplayLayout.UIElement)).LastElementEntered.GetType() == typeof(EditorWithTextDisplayTextUIElement)) { //Your code here... } } MouseEventArgs mouseCaptured; private void ultraCombo1_MouseClick(object sender, MouseEventArgs e) { mouseCaptured = e; }
Please review the above code and feel free to let me know if I misunderstood you or if you have any other questions.
Hi all,
I having a same problem right now.
Things should go like this, user select a data from ultracombo, then reflect some data in others text box or grid based on the selection of ultracombo. Im using AfterCloseUp function to cater the user selection, but I facing problem when they close the dropdown without select anything and use the KEYBOARD ARROW KEY to make the selection.
How can I get the selected data by ARROW KEY FROM KEYBOARD?
Please guide.
Warm regards,
PC