reading and setting location for horizontal srcoll bar

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
 
G

Grant Smith

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top