We are using a GridDataBoundGrid as a filter row to the main grid and need to sychronise column positions and widths between grids.
If you select a column in our filter grid that is not fully visible the row is scrolled until the column is visible. However, this causes the filter grid and main grid to get out of alignment. Is there a way to prevent the GDBG from autoscrolling?
Thanks
AD
Administrator
Syncfusion Team
July 26, 2006 09:42 AM UTC
Hi Jay,
You can subscribe to the TopRowChanging event and set e.Cancel = true when you want to stop the auto scrolling and then un-subscribe when you want to start them. Here is a code snippet.
////For Vertical scrolling , to subscribe TopRowChanging event and handle the e.Cancel arg.
this.grid.TopRowChanging +=new GridRowColIndexChangingEventHandler(grid_TopRowChanging);
private void grid_TopRowChanging(object sender, GridRowColIndexChangingEventArgs e)
{
e.Cancel = true;
}
////to unsubscribe TopRowChanging event
this.grid.TopRowChanging -=new GridRowColIndexChangingEventHandler(grid_TopRowChanging);
Let me know if this helps.
Best Regards,
Haneef
JA
Jay
July 26, 2006 10:45 AM UTC
Thanks for the reply. Is there an equivalent for horizontal scrolling?
The problem is that a partially visible column is scrolled left or right until it is visible which causes the grids to become misaligned.
AD
Administrator
Syncfusion Team
July 26, 2006 11:04 AM UTC
Hi Jay,
You need to subscribe the LeftColChanging event and set e.Cancel to true. Please find the code snippet below.
this.grid.LeftColChanging +=new GridRowColIndexChangingEventHandler(grid_LeftColChanging);
private void grid_LeftColChanging(object sender, GridRowColIndexChangingEventArgs e)
{
e.Cancel = true;
}
Best Regards,
Haneef
JA
Jay
July 26, 2006 12:20 PM UTC
That works great. Thanks for your help!