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

prevent a specific row from being dragged

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.

1 Reply

HA haneefm Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon