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 cell moves in grid

Thread ID:

Created:

Updated:

Platform:

Replies:

7063 Sep 10,2003 10:00 PM UTC Sep 12,2003 11:41 AM UTC WinForms 4
loading
Tags: GridControl
Rick
Asked On September 10, 2003 10:00 PM UTC

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

Administrator [Syncfusion]
Replied On 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);

Rick
Replied On 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); >

Administrator [Syncfusion]
Replied On 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;
	}
}

Rick
Replied On 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;
> 	}
> }
> 
>

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

;