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
close icon

Prevent cell moves in grid

I'm able to keep the rows and columns from moving but I can't figure out how to prevent a single cell from moving to another cell. Thanks

4 Replies

AD Administrator Syncfusion Team September 11, 2003 06:38 AM UTC

To turn off OLE D&D (which is what I think you are describing), you trun off the GridControllerOptions.OleDataSource flag in the gridControl1.ControllerOptions property. gridControl1.ControllerOptions = GridControllerOptions.All & (~GridControllerOptions.OleDataSource);


RI Rick September 12, 2003 01:51 AM UTC

I still require drag and drop (I drag items in). I just don't want the user to be able to move a cell. I was able to prevent it by putting code in the OnDrop and checking to see if it was GridData. This works but I can't prevent the drag icon from showing. Rick > To turn off OLE D&D (which is what I think you are describing), you trun off the GridControllerOptions.OleDataSource flag in the gridControl1.ControllerOptions property. > > > gridControl1.ControllerOptions = GridControllerOptions.All & (~GridControllerOptions.OleDataSource); >


AD Administrator Syncfusion Team September 12, 2003 07:59 AM UTC

Try the QueryCanOleDragRange event. This should allow you not to show the cursor and also to avoid the drag.
private void gridControl1_QueryCanOleDragRange(object sender, GridQueryCanOleDragRangeEventArgs e)
{
	if(e.Range.Width == 1 && e.Range.Height == 1)
	{
		e.Cancel = true;
	}
}


RI Rick September 12, 2003 11:41 AM UTC

Excellent. Thanks! > Try the QueryCanOleDragRange event. This should allow you not to show the cursor and also to avoid the drag. > >
> private void gridControl1_QueryCanOleDragRange(object sender, GridQueryCanOleDragRangeEventArgs e)
> {
> 	if(e.Range.Width == 1 && e.Range.Height == 1)
> 	{
> 		e.Cancel = true;
> 	}
> }
> 
>

Loader.
Live Chat Icon For mobile
Up arrow icon