Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
233
Unselecting Items XamlDataGrid
posted

 Hi,

 I´m working with the XamlDataGrid and currently when the Grid is loaded I´m selecting the first element of the Grid, using the following code:

     this.gridDataPresenter.SelectedItems.Records.Add(gridDataPresenter.Records[0]);

This code is working fine, but the problem is that later I need to unselect the selected items of the Grid, for later selecting only the first item. For unselecting the record I´m using the following code, that is giving me an exception.

   this.gridDataPresenter.SelectedItems.Records.Clear();

 As I read on the documentation of the Records attribute, this propery is not accesible on run time. So I will like to know if there is a way to unselect the items on a Grid.