New to Telerik UI for WPF? Download free 30-day trial

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 System.Windows.Controls.SelectionChangedEventHandler(OnSelectionChanged)); 
Me.radGridView.AddHandler(RadComboBox.SelectionChangedEvent, New System.Windows.Controls.SelectionChangedEventHandler(AddressOf OnSelectionChanged)) 

Example 2: Handle the SelectionChanged event

private void OnSelectionChanged(object sender, SelectionChangedEventArgs e) 
    { 
        if (e.RemovedItems.Count > 0) 
        { 
            //your code here 
        } 
    } 
Private Sub OnSelectionChanged(ByVal sender As Object, ByVal e As 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

In this article