Controlling vertical scrollbar position on DataGridView WinFormcontrol.

J

JDeats

I have a WinForm with two DataGridView controls with drag and drop
enabled between the two.

I have a scenario where a DataGridView control can have rows
dynamically inserted at random positions when a user drags an item
from DataGridView A into DataGridView B and MouseUp is performed I
perform an insert. Each time the user takes this action in order to
achieve the insert I am reconstructing the rows by calling the Add()
method off of the DataGridView control and programmaticly setting
properties of each row item.

When the grid is reconstructed in this manner the vertical scrollbar
is positioned at it's default location (bar at top most position) this
is undesirable.

I would like to be able to record the verical scroll bar position when
the drag and drop operation completes and after the grid has been
reconstructed to set the scrollbar position to this value. When you
have a scenario where there are hundreds of rows this becomes a
requirement.
 

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