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
325
Deselect records on margin click?
posted

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

Parents
  • 69686
    Suggested Answer
    posted

    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();

            }

Reply Children