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

GridControl selection question

Hi -
I am using the GridControl and need the following behavior:

User can only select one row at a time using the row header (no dragging the mouse or keyboard arrows, etc. to include other rows)

Selecting a cell also selects a row (on cell click i clear all selections and the select the row), so no selecting of multiple cells across multiple rows dragging the mouse or using the keyboard.

What are the proper controller options and event handling to prevent the mouse down dragging and keyboard selection of multiple rows/cells?

Thanks,
Julie

2 Replies

HA haneefm Syncfusion Team July 23, 2007 09:38 PM UTC

Hi Julie,

You can try these code:

this.gridControl1.AllowSelection = GridSelectionFlags.Row | GridSelectionFlags.AlphaBlend;
this.gridControl1.SelectionChanging += new GridSelectionChangingEventHandler(gridSelectionChanging);

void gridSelectionChanging(object sender, GridSelectionChangingEventArgs e)
{
e.Cancel = e.Reason != GridSelectionReason.MouseDown;
}

Best regards,
Haneef


JL Julie Levy July 23, 2007 10:40 PM UTC

Thanks Haneef!

Loader.
Live Chat Icon For mobile
Up arrow icon