are there is event like SelectionChangeCommitted in the rad ComboBox in win forms ?
the pwoer of this event is that SelectionChangeCommitted is raised only when the user changes the combo box selection. if you use SelectedIndexChanged or SelectedValueChanged to capture user changes, because those events are also raised when the selection changes programmatically.
9 Answers, 1 is accepted
Thank you for contacting us.
Unfortunately we do not have such a property, but what you can do here is subscribe for the DropDownOpened event, and then in it subscribe for the SelectedIndexChanged event and this is how you can access "changing by user" event:
I hope this helps. If you have any other questions, do not hesitate to contact us.
the Telerik team
We removed RadComboBox control from our suite and now it is replaced with the RadDropDownList control. We decided that the described functionality is a very specific scenario which can be implemented with custom code and it should not be included in RadDropDownList implementation. I am posting here an updated version of the solution offered by my colleague:
I hope it helps.
the Telerik team
Despite this is an old subject/post, I am trying to implement your solution, but, what if I need both previous and new values?
I remember there was something like:
e.OldIndex and e.NewIndex
But now I can't find them withing PositionChangedEventArgs.
Any clue? (I would not like to use a variable to explicitly get index every time it changes)
Thanks in advanced.
If you do not want to use a variable, then you can use the SelectedIndexChanging event. At the time it triggers, the control will hold the old SelectedIndex, and the event will provide the new one:
I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.
Thanks very much Stefan, it works as expected.
One more question, I am dynamically adding this RadDropDownList, and I need to pre select some default item.
I am trying with:
But it seems that after line ddl.DataSource = dv items count is always 0 even when dv has items.
I am sorry for take advantage of this post.
Thanks in advance,
Complementing previous post:
In fact, after WinForm finish loading, The dropdown (ddl) has items, but none item is selected.
If you execute this code in the form's constructor, the item will not be selected indeed, however, if you move it to Form.Load or a later event, the item will be correctly selected.
I hope this helps.
PS. Indeed, it is better to keep just one topic per thread so the forums are easy to navigate. We will appreciate it if you separate the unrelated questions in separate threads. Thanks.