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
SIGN IN To post a reply.
5 Replies
AD
Administrator
Syncfusion Team
October 12, 2004 01:24 PM UTC
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 02:52 PM UTC
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 07:25 PM UTC
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 09:42 PM UTC
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 06:48 PM UTC
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;
> }
>}
>
SIGN IN To post a reply.
- 5 Replies
- 3 Participants
-
GR Gordon Rhea
- Oct 12, 2004 12:51 PM UTC
- Nov 3, 2004 06:48 PM UTC