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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Syncfusion DataBoundGrid row selection

Thread ID:

Created:

Updated:

Platform:

Replies:

68321 Sep 18,2007 08:38 AM UTC Sep 28,2007 03:55 PM UTC Windows Forms 4
loading
Tags: GridControl
Robert Hancliff
Asked On September 18, 2007 08:38 AM UTC

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

Jisha Joy [Syncfusion]
Replied On 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

Robert
Replied On 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

Jisha Joy [Syncfusion]
Replied On 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

Robert
Replied On September 28, 2007 03:55 PM UTC

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;