Hello Gourav,
I am sorry about this delay in responding. If your intention is to restrict the horizontal scrollbar to move back to the start position while moving the grid columns from
one position to another you can do this by setting the column index value within the GridDataBoundGrid.QueryScrollCellInView event. Below is the sample code snippet
that demonstrates this.
// Occurs before the grid is scrolled when the left column index is changed.
this.gridDataBoundGrid1.LeftColChanging += new GridRowColIndexChangingEventHandler(gridDataBoundGrid1_LeftColChanging);
this.gridDataBoundGrid1.QueryScrollCellInView += new GridQueryScrollCellInViewEventHandler(gridDataBoundGrid1_QueryScrollCellInView);
int hsScrollBar;
void gridDataBoundGrid1_LeftColChanging(object sender, GridRowColIndexChangingEventArgs e)
{
this.hsScrollBar = this.gridDataBoundGrid1.HScrollBar.Value;
}
void gridDataBoundGrid1_QueryScrollCellInView(object sender, GridQueryScrollCellInViewEventArgs e)
{
e.ColIndex = this.hsScrollBar;
}
I have also attached the sample with this post that shows the above details -
http://websamples.syncfusion.com/samples/Grid.Windows/F67286/main.htmPlease look into the above details and let me know if you have any questions.
Best Regards,
Meera.
Syncfusion, Inc.
http://www.syncfusion.com/