Syncfusion DataBoundGrid row selection

I currently have a grid with nearly all the functionality added now so changes are not appreciated :). Anyway currently if a user wants to select multiple rows they can do this. However when the user right clicks on a row there current selection is removed and that single row is selected. This is even when they click inside the current selection.

The work round for now is to use the right mouse to drag select and the menu pops up on release.

However I would like to ask if there is a way to have the grid make no changes to the current selection on right click. Thanks

4 Replies

JJ Jisha Joy Syncfusion Team September 24, 2007 02:02 PM UTC

Hi Robert,

Thankyou for your interest in Syncfusion Products.

It is possible to make no changes in the current selection on right click by using the SelectionChanging event in gridControl.
Here is the code snippets:

void gridControl1_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
{ if (Control.MouseButtons.Equals(System.Windows.Forms.MouseButtons.Right))
e.Cancel=true;
}



Please try this and let me know if you have any questions.

Regards,
Jisha


RO Robert September 24, 2007 04:06 PM UTC

Sorry yea it sounds like it would work, this is SyncFusion 4.3.0 and that event doesn't exist. I didn't spot a similiar one either. It is a task that needs completing however so i'll have to get it done at some point soon :)

Thanks anyway


JJ Jisha Joy Syncfusion Team September 26, 2007 01:06 PM UTC

Hi Robert,

Thank you for your interest in Syncfusion products.

In the previous update the code snippet shows SelectionChanging event of GridControl and in GridDataBoundGrid control also have this event is available in gridDataBoundGrid1.Model.
Here is the code snippets:

//Event
this.gridDataBoundGrid1.Model.SelectionChanging += new Syncfusion.Windows.Forms.Grid.GridSelectionChangingEventHandler(Model_SelectionChanging);
//Event handler
void Model_SelectionChanging(object sender, Syncfusion.Windows.Forms.Grid.GridSelectionChangingEventArgs e)
{
if (Control.MouseButtons.Equals(System.Windows.Forms.MouseButtons.Right))
e.Cancel = true;
}


Please refer the following sample that illustrate the same:
http://websamples.syncfusion.com/samples/Chart.Windows/68321/main.htm

Please try this and let me know if you have any questions.

Regards,
Jisha


RO Robert September 28, 2007 03:55 PM UTC

Yep that has cleared the problem up, I needed the Model event, cheers guys

Loader.
Up arrow icon