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

GDBG Drag drop refresh

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

5 Replies

AD Administrator Syncfusion Team October 12, 2004 08: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


GR Gordon Rhea October 12, 2004 09:52 AM

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


JE jeaning 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


AD Administrator Syncfusion Team 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;
	}
}


JE jeaning 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;
>	}
>}
>

Loader.
Live Chat Icon For mobile
Up arrow icon