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.

Drap and Drop in Virtual Cells

Thread ID:

Created:

Updated:

Platform:

Replies:

18987 Sep 15,2004 05:11 AM Sep 16,2004 05:10 AM Windows Forms 3
loading
Tags: GridControl
Suresh Mani
Asked On September 15, 2004 05:11 AM

Hi, I am using virtual cells in the GridContol. When I drag a virtual cell from one grid and drop into another grid the value in the source grid is lost also in the destination grid. The same behavior is happened while dragging an ordinary cell and drop into virtual cell. Herewith I have attached a sample program to show the problem. Kindly let me know how to solve the problem. Thanks, Suresh Mani. GridDragDrop_1097.zip

Administrator [Syncfusion]
Replied On September 15, 2004 05:57 AM

The default behavior of a OLE D&D is to do a move, and not a copy. This will clear the data from the source of the drop. If you want a copy instead of a move, the convention is to hold down teh control key when you do the drop. If you do hold down the control key as you drop, the information in the source should not be affected. If you want to change this default behavior, one way is to derive the GridControl and override OnDragDrop. In the override, after calling the baseclass, set e.Effects to Copy.
public class MyGridControl : GridControl
{
	protected override void OnDragDrop(DragEventArgs drgevent)
	{
		base.OnDragDrop (drgevent);
		drgevent.Effect = DragDropEffects.Copy;
	}
}

Suresh Mani
Replied On September 16, 2004 04:11 AM

Hi Clay Burch, The solution solves the problem for loosing data in the source cell. But still the virtual cell problem is existed. Here I attached sample program to show the problem. 1. Run the application. 2. Drag virtual cell data from one grid into another grid virtual cell. Now you can see that the dragged data not appeared in the cell, also while dropping the virtual cell mode is disappeared. Kindly let me know how to solve the problem. Thanks Suresh Mani. DragDropInVirtualCell_379.zip

Administrator [Syncfusion]
Replied On September 16, 2004 05:10 AM

The sample you attached does not use a virtual grid. It stores data in the GridData object using indexers on the grid. With that sample, I do not see a problem with D&D. Here is the picture of what I see after running the sample, selecting cells on the left grid and dragging them to the right grid. dndgrid_5020.zip By default, a grid supports dragging both styles and text formats. In a virtual grid, there are no style formats available for the drag as no style information is stored by the grid. So, in a virtual grid, you can tell the grid to only try to use the Text format by removing the styles flag from the DragDropTargetFlags: gridControl1.Model.Options.DragDropDropTargetFlags &= ~GridDragDropFlags.Styles;

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.

;