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.

Prevent cell moves in grid

Thread ID:

Created:

Updated:

Platform:

Replies:

7063 Sep 10,2003 06:00 PM Sep 12,2003 07:41 AM Windows Forms 4
loading
Tags: GridControl
Rick
Asked On September 10, 2003 06:00 PM

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 02:38 AM

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 11, 2003 09:51 PM

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 03:59 AM

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 07:41 AM

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.

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.

;