This is a migrated thread and some comments may be shown as answers.

Clear the grid row selection if a user clicks outside the grid area.

1 Answer 1603 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Amit
Top achievements
Rank 1
Amit asked on 28 Mar 2018, 04:33 PM

Hi Team,

I have query on Radgridview selection row:

- How can I clear row selection if a user click outside the grid.?

 

Thanks,

Amit Kulha

 

 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 30 Mar 2018, 11:29 AM
Hi Amit,

To clear the selected row you can subscribe to the LostFocus event of the RadGridView. In the event handler, you can set the SelectedItem property to Null. Check the following code snippet.
private void gridView_LostFocus(object sender, RoutedEventArgs e)
{
    var gridView = sender as RadGridView;
    gridView.SelectedItem = null;
}

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Amit
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or