I am trying to use xamDataGrid.SelectedItems.Record.Clear() to clear all selections in a XamDataGrid, however, the selected row is still selected.
I found an old question in the forum: http://es.infragistics.com/community/forums/p/73241/370597.aspx#370597, I downloaded the sample WpfApplication16.zip from the team member to try, when run the sample, I am not able to clear the selection.
I am on Infragistics WPF version 14.2.
Thanks.
Hello yingwu,
Thank you for the feedback. I am glad, that you have found a solution to your issue. Please do not hesitate to let me know if you have any further questions on this matter.
Hi Dimitrova,
Thanks for your response.
Yes, I was puzzled by the blue background when trying to clear the selections.
Instead of create a style to set the DataRecordCellAcrea, I add the following line after the SelectedItems.Records.Clear():
xamDataGrid.ActiveDataItem = null;
This will clear the selected items, also remove the blue background of the selected item.
Thank you for your help.
Thank you for your post!
I have been looking into it and have downloaded the sample application you have mentioned. I have changed the dlls to use Infragistics 14.2 and the sample application works as expected.
When you select a record from the XamDataGrid, then press the button, that clears the selected items you would see the MessageBox, that shows how many items are cleared. Then if you check the count of the records in the SelectedItems collection you would see that the items there are 0.
If you are talking about the blue background that you see, when an item is selected - this is the background for the Active record. When one record is selected it becomes active too.
If you create a style for the DataRecordCellArea and set the BackgroundActive and BorderActiveBrush brushes to "Transparent" you would see that the background is cleared too, when the selected items are cleared.
Please do not hesitate to let me know if you have any further questions on this matter.