Hello,
We're trying to deselect all selected records when the user clicks anything but a record.
For example, in the attached image, if the user clicks the circled area, the parent record ("Biography") is selected. We would like to deselect all records when this happens.
Any ideas?
Thanks,
Matt
Hello Matt,
You can try handling the PreviewMouseLeftButtonDown event of the XamDataGrid and see if you can find a DataRecordCellArea element. If none is found, you can deselect all records, something like this:
void xamDataGrid1_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
DataRecordCellArea area = Infragistics.Windows.Utilities.GetAncestorFromType(e.OriginalSource as DependencyObject,
typeof(DataRecordCellArea), false) as DataRecordCellArea;
if (area == null)
xamDataGrid1.SelectedItems.Records.Clear();
}
Thanks for the response,
I have tried what you provided, also by just using "xamDataGrid1.SelectedItems.Records.Clear();" in a button.
Both seem to not work.
Matt.