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

Disabling Row Select in GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

100153 Jul 7,2011 02:28 PM UTC Jul 11,2011 01:44 PM UTC Windows Forms 1
loading
Tags: GridControl
Greg DeArment
Asked On July 7, 2011 02:28 PM UTC

Hello -
Is there a way to disable the row select for a grid control? Currently, when the mouse hovers over the left most column, the cursor changes to the row select cursor. The CellCursor event does not appear to fire for Column 0.


Asarudheen S [Syncfusion]
Replied On July 11, 2011 01:44 PM UTC

Hi Greg,

You can disable the row select for grid control along with the following code.


gridControl1.AllowSelection = GridSelectionFlags.Column | ~GridSelectionFlags.Row;


(or) through SelectionChanging event handler you can block some specific rows with the following code.


gridControl1.SelectionChanging += new GridSelectionChangingEventHandler(gridControl1_SelectionChanging);

private void gridControl1_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
{
if (e.Reason == GridSelectionReason.MouseDown)
{
if (e.Range.IsRows)
{

switch (e.Range.Top)
{
case 1:
case 2:
case 3:

e.Cancel = true;
break;
}
}

}


Here is a sample for your refernce.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=Forum350260140.zip

Please let me know if you need any further assistance.

Thanks,
Asarudheen.




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

;