We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Scrooll Bar Issue

Hi
i am using GridDataBound Grid and i have faced a issue in grid scrollBar. when ever i moved one column from one position to another position . the scrollbar comes to the start position(Means again comeback to the first column ) not to the column where it comes as per normal.

So pl'z suggest me solution for the problem

Thanks in Advance
Gourav Nayyar

1 Reply

MF Meera Fathima Syncfusion Team August 18, 2007 09:24 AM UTC



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.htm

Please look into the above details and let me know if you have any questions.

Best Regards,
Meera.

Syncfusion, Inc.
http://www.syncfusion.com/


Loader.
Live Chat Icon For mobile
Up arrow icon