Hi Sathish,
Sorry for the long delay caused.
In a GridGrouping Control, the grid just displays the rows as they are presented to it by the underlying datasource. So, if you want to move the position of the rows currently, you have to do so by moving them in the underlying datasource.
One way of doing it is to add an additional column to the datatable that holds a sortKey that reflects where you want the rows to be. You don't display this column ( you can just hide it in the grid as the sample does). When you initially set the DataSource to the grid, you sort the datatable on this column using its defaultview.sort property. Then when you want to move rows, all you have to do is to move the sortKey values and the rows will rearrange themselves (as they must maintain the sort order).
void Swap(int row1, int row2)
{
CurrencyManager cm = (CurrencyManager)this.BindingContext[this.gridGroupingControl1.DataSource, this.gridGroupingControl1.DataMember];
if (row1 < cm.Count && row2 < cm.Count && row1 > -1 && row2 > -1)
{
DataRowView drv1 = (DataRowView)cm.List[row1];
int val1 = (int)drv1.Row["sortKey"];
DataRowView drv2 = (DataRowView)cm.List[row2];
int val2 = (int)drv2.Row["sortKey"];
drv1.Row["sortKey"] = val2;
drv2.Row["sortKey"] = val1;
}
}
Here is the sample:
http://websamples.syncfusion.com/samples/Grid.Windows/Grid_WF_GGCSwapRowsF73068/main.htm">Please have a look into the above sample and let me know if it helps.
Regards,
Subhasheela R