Edit this page

Handle SelectionChanged for GridViewComboBoxColumn

GridViewComboBoxColumn does not expose a SelectionChanged event itself. In case you need such an event to implement your additional logic, you can handle the SelectionChanged event of its editing element (RadComboBox). For example the code to do so is available bellow:

Example 1: Add a handler for the SelectionChanged event

this.radGridView.AddHandler(RadComboBox.SelectionChangedEvent, new Telerik.Windows.Controls.SelectionChangedEventHandler(OnSelectionChanged));
Me.radGridView.AddHandler(RadComboBox.SelectionChangedEvent, New Telerik.Windows.Controls.SelectionChangedEventHandler(AddressOf OnSelectionChanged))

Example 2: Handle the SelectionChanged event

private void OnSelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
        if (e.RemovedItems.Count > 0)
            //your code here
Private Sub OnSelectionChanged(ByVal sender As Object, ByVal e As Telerik.Windows.Controls.SelectionChangedEventArgs)
    If e.RemovedItems.Count > 0 Then
        'your code here
    End If
End Sub

You can see that with the code snippet above I check if there are any items being unselected (through the RemovedItems.Count). This ensures the event will not be handled on initial loading when a default item has been selected.

See Also