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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

prevent a specific row from being dragged

Thread ID:

Created:

Updated:

Platform:

Replies:

59164 Apr 5,2007 05:55 PM UTC Apr 5,2007 06:11 PM UTC WinForms 1
loading
Tags: GridControl
Jan Eugenides
Asked On April 5, 2007 05:55 PM UTC

It seems like this should be easy, but I have searched the knowledge base, help files, and forums without finding the answer :)

How can I prevent a specific ROW from being dragged, if the AllowDragSelectedRows is set to True. This is in a GridControl, not a bound grid. I want to lock certain rows so that they cannot be moved, and allow others to move.

Thanks in advance.

haneefm [Syncfusion]
Replied On April 5, 2007 06:11 PM UTC

Hi Jeugenides ,

This can be achieved by handling the MouseDown event of the Grid. In that event, you need to set the AllowSelectedRows property to false for the required row in a grid. You can use the following code snippet to achieve this.

private void gridControl1_MouseDown(object sender, MouseEventArgs e)
{
GridControl grid = sender as GridControl;
Point pt = new Point(e.X,e.Y);
int row,col;
if( grid.PointToRowCol( pt,out row,out col))
{
if( row == 4 && col == 0)
grid.AllowDragSelectedRows = false;
else
grid.AllowDragSelectedRows = true;
}
}

Best regards,
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.

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

;