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
715
How to keep ActiveRecord at initial selection while allowing multiselect?
posted

Hi,

I have the following requirements:

  • The grid should allow multi-select.
  • When the user does a multi-select (say with Ctrl-click), the active record should stay at the initial selection instead of moving to the last selection.

Is this possible to do?

Thanks,

Harold

Parents
No Data
Reply
  • 35319
    posted

    Hello Harold,

     

    I have been looking into your question and I can suggest you handle the ‘PreviewMouseLeftButtonUp’ event of the XamDataGrid and set the ‘ActiveRecord’ to the first item from the SelectedItems like e.g :

     

     

            private void xamDataGrid1_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)

            {

                Record active = this.xamDataGrid1.SelectedItems.FirstOrDefault() as Record ;

                this.xamDataGrid1.ActiveRecord = active;

            }

     

    If you have any other questions on this matter, feel free to ask.

Children