We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridDataControl SelectedItems before MouseUp

Hi,

I'm using the GridDataControl in version 9.4.

Is there any way to get the selectedItems before MouseUp (ideally on mouseDown or previewMouseDown) on the selected row? I am able to workaround the row that was clicked on through PointToCellRowColumnIndex, but how do i get the items that have been selected in a Shift or Ctrl selection?

The GridDataControl.SelectedItems is still empty at that time.

Thanks,
Rich

1 Reply

SA Santhosh A Syncfusion Team August 27, 2012 01:17 PM UTC

Hi Rich,

Thanks for using Syncfusion products.

We have analyzed your query and we are selecting the items in Mousedown Event, So we  can’t get the selected items before MouseUp Event, but you can get whether the key Pressed is Control or Shift by Handling the PreviewKeyDown Event. Please refer the below Code Snippet.

CodeSnippet[C#]:

this.dataGrid.PreviewKeyDown += new KeyEventHandler(dataGrid_PreviewKeyDown);

void dataGrid_PreviewKeyDown(object sender, KeyEventArgs e)

        {

            isControlKey = (e.KeyboardDevice.Modifiers & ModifierKeys.Control) != ModifierKeys.None;

            isShiftKey = (e.KeyboardDevice.Modifiers & ModifierKeys.Shift) != ModifierKeys.None;

        }

Please let us know if you have any queries.

 

Regards,

Santhosh.A


Loader.
Live Chat Icon For mobile
Up arrow icon