reading and setting location for horizontal srcoll bar

  • Thread starter Thread starter ZR
  • Start date Start date
Z

ZR

is there a way to control (get and set) the position of a Datagrid's,
horizontal scrollbar?

I am linking the datagrid to a very large table (hundreds of thousands of
records)
i cannot connect it to all the data at once since it would require lots and
lots of memory.
so i break up the table into sections, and i refresh the data as the user
scroll to provide the next section.
but when grid is refreshed the horizontal scrollbar losses its position.

Thanks in advance for you help.
zr
 
You need to create your own DataGrid class to inherit from the
DataGrid. This way you can access GridHScrolled and GridVScrolled
methods which are protected otherwise. Using those two methods will
let you scroll vertically or horizontally

Example:
(Me refers to the new datagrid class object that I created)
Me.GridHScrolled(Me, New
ScrollEventArgs(ScrollEventType.LargeIncrement, intNewPos))

To get the positions:
Me.VertScrollBar.Value

Me.HorizScrollBar.Value

HTH

Grant
 
Back
Top