Drag Drop of columns

Hi,

I'm currently working with Sycfusion Ver 6.1.0.34. My objective is when we drop a column we see whether its dependent on any other column if so we need to move all the dependent column along with it to the target position. Assume that the dependent columns are always sequential. I tried handling the case in Grid.ColsMoving event and capture the column # to see whether its dependent. I tried selecting the dependent column in the ColsMoving event but dont know how to stop this move and start a new move of all the dependent columns Please help me out of this issue

Thanking you in advance

Regards
damo...

1 Reply

RC Rajadurai C Syncfusion Team May 19, 2009 03:30 PM UTC

Hi Damodhar,

Thanks for your interest in Syncfusion products.

To prevent a column from being dropped to certain column while moving, please try to handle the following code in ColsMoving event.

private void gridControl1_ColsMoving(object sender, Syncfusion.Windows.Forms.Grid.GridRangeMovingEventArgs e)
{
if(e.Target == 3)
{
e.Cancel = true;
this.gridControl1.Cols.MoveRange(e.From,1,e.From);
}
}

This prevents the column moved from being dropped, if the target column is 3rd in grid.

Regards,
Rajadurai

Loader.
Up arrow icon