This project is read-only.

Setting the scroll position for virtual grid

Nov 13, 2009 at 11:29 AM

I am rewriting a real grid to become a virtual grid, and can't find a way to scroll to a certain row.

For real grid, I figured, that if I set selection mode to row and scroll like this, it is ok:

            grid1.Selection.SelectRow( row  , true);

            grid1.Selection.FocusRow( row );


            grid1.Selection.SelectRow( row  , true);
            grid1.Selection.FocusRow( row );


It worked. However, NOTHING I TRIED worked for VIRTUAL grid. 

Here is the list of statements I tried (most are commented now) to let you know that I did try hard.


            grid1.Selection.SelectRow( row  , true);

            grid1.Selection.FocusRow( row );

            //grid1.ScrollOnPoint(new Point( 0, row ));//

            //grid1.ScrollControlIntoView( grid1[ 

            //grid1.Rows.FirstVisibleScrollableRow= row;

            //grid1.VerticalScroll.Value = Convert.ToInt32(  (grid1.VerticalScroll.Maximum - grid1.VerticalScroll.Minimum) * ( (TOTAL_ROWS_COUNT - row) /Convert.ToDouble( TOTAL_ROWS_COUNT ) ) ); 

            //grid1.Selection.Focus(new Position(row, 0), true );




Jan 7, 2010 at 4:16 PM

did you find a solution? i now have the same problem and don't find a way to solve it.

i thought using the autoscroll feature of a scrollablecontrol would work, but i can't set the DataGrid.AutoScroll property to true.

Jan 7, 2010 at 9:09 PM

if anybody else searches a clue, look at: ShowCell :-)

Jul 8, 2013 at 5:33 AM
Showcell doesn't work with real grid:
Dim p As SourceGrid.Position = New SourceGrid.Position(3, 52)
  Grid1.ShowCell(p, True)
Maybe some bug?