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.

GDBG Drag drop refresh

Thread ID:

Created:

Updated:

Platform:

Replies:

20201 Oct 12,2004 08:51 AM Nov 3,2004 01:48 PM Windows Forms 5
loading
Tags: GridControl
Gordon Rhea
Asked On October 12, 2004 08:51 AM

Hi, I''m doing a drag-drop between two Databound Grids to move data between them. The move is working correctly but the source DBG isn''t refreshing the cell information after the drag-drop operation moves that cell to the target DBG. The text of the cell stays the same as it was until another cell is clicked on in that DBG then the correct data is displayed. I''ve tried calling GridDataBoundGrid1.Refresh() but that hasn''t solved the problem. How can I force the DBG to do a refresh so the correct data is displayed? Thanks, Gordon

Administrator [Syncfusion]
Replied On October 12, 2004 09:24 AM

Hi Gordon, does it help if you call GridDataBoundGrid1.CurrentCell.Refresh()? Also, if the current cell is in editing mode, try calling GridDataBoundGrid1.CurrentCell.Deactivate(). Stefan

Gordon Rhea
Replied On October 12, 2004 10:52 AM

Calling GridDataBoundGrid1.CurrentCell.Deactivate() did the trick. calling GridDataBoundGrid1.CurrentCell.Refresh() didn''t affect the problem at all. Thanks Stefan Gordon

jeaning
Replied On November 2, 2004 02:25 PM

Hi, Right now, I am doing the copy operation. I mean copy the text of cell from GridDataboundGriid1 to GridDataboundGrid2. even I set the DragDropEffects.copy at the GridDataboundGrid2''s DragEnter. the operation still deletes the souce cell content. But I want to keet it. Question2 is how could I let the Drop only happen at the certain columns. Thanks Ning >Hi, >I''m doing a drag-drop between two Databound Grids to move data between them. The move is working correctly but the source DBG isn''t refreshing the cell information after the drag-drop operation moves that cell to the target DBG. The text of the cell stays the same as it was until another cell is clicked on in that DBG then the correct data is displayed. >I''ve tried calling GridDataBoundGrid1.Refresh() but that hasn''t solved the problem. How can I force the DBG to do a refresh so the correct data is displayed? > >Thanks, >Gordon

Administrator [Syncfusion]
Replied On November 2, 2004 04:42 PM

1) Try handling the DragDrop event on teh target grid and set the e.Effect there.
private void gridDataBoundGrid2_DragDrop(object sender, DragEventArgs e)
{
	e.Effect = DragDropEffects.Copy;
}


2) You can use the DragOver event on the target to disallow a drop. Here is a handler taht will not drop if the mouse is over column 2.
private void gridDataBoundGrid2_DragOver(object sender, DragEventArgs e)
{
	Point pt = this.gridDataBoundGrid2.PointToClient(new Point(e.X, e.Y));
	int row, col;
	if(this.gridDataBoundGrid2.PointToRowCol(pt, out row, out col, -1))
	{
		if(col == 2)
			e.Effect = DragDropEffects.None;
	}
}

jeaning
Replied On November 3, 2004 01:48 PM

That helps. Thanks a lot. >1) Try handling the DragDrop event on teh target grid and set the e.Effect there. >
>private void gridDataBoundGrid2_DragDrop(object sender, DragEventArgs e)
>{
>	e.Effect = DragDropEffects.Copy;
>}
>
>
>2) You can use the DragOver event on the target to disallow a drop. Here is a handler taht will not drop if the mouse is over column 2.
>
>private void gridDataBoundGrid2_DragOver(object sender, DragEventArgs e)
>{
>	Point pt = this.gridDataBoundGrid2.PointToClient(new Point(e.X, e.Y));
>	int row, col;
>	if(this.gridDataBoundGrid2.PointToRowCol(pt, out row, out col, -1))
>	{
>		if(col == 2)
>			e.Effect = DragDropEffects.None;
>	}
>}
>

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.

;