Hey,
I want to change the selected item selected by the user by an another item.
I put the following code, but the selected item is not changed :/
Private Sub myCombo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles myCombo.SelectedIndexChanged
myCombo.EditorControl.CurrentRow = myCombo.EditorControl.Rows(myNumRow)
myCombo.EditorControl.CurrentRow.IsSelected = True
myCombo.EditorControl.CurrentRow.IsCurrent = True
End sub
Do you have an idea pls ?
NB : I'm on Q1 2015
5 Answers, 1 is accepted
Thank you for writing.
You can directly set the selected index. For example:
Private
Sub
radMultiColumnComboBox1_SelectedIndexChanged(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
If
radMultiColumnComboBox1.SelectedIndex <> 2
Then
radMultiColumnComboBox1.SelectedIndex = 2
End
If
End
Sub
Please let me know if there is something else I can help you with.
Dimitar
Telerik
Thanks for your reply.
Your code works on a blank project but not on mine :/
Maybe, i'm using too many events on this control + a lightVisualElement.
I'll continue to investigate :)
Take all the time you need to examine this and do not hesitate to contact us if you need further assistance.
Regards,
Dimitar
Telerik
In fact, i wanted to cancel the selection of my item on a certain condition.
Private Sub cmyCombo_CurrentRowChanging(ByVal sender As Object, ByVal e As CurrentRowChangingEventArgs) Handles myCombo.EditorControl.CurrentRowChanging
If Not e.NewRow Is Nothing AndAlso e.NewRow.Cells(Nom).Value = "" Then
e.Cancel = True
myCombo.MultiColumnComboBoxElement.ClosePopup()
End If
End Sub
This code works :)
I am glad that you have fond a solution for your case. Let us know if you have any other questions.
Regards,
Dimitar
Telerik