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.

GridControl selection question

Thread ID:

Created:

Updated:

Platform:

Replies:

64614 Jul 23,2007 01:52 PM Jul 23,2007 06:40 PM Windows Forms 2
loading
Tags: GridControl
Julie Levy
Asked On July 23, 2007 01:52 PM

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

haneefm [Syncfusion]
Replied On July 23, 2007 05:38 PM

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

Julie Levy
Replied On July 23, 2007 06:40 PM

Thanks Haneef!

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.

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.

;