G
Gene Hubert
I'm assigning a new datasource (a datatable) to a datagrid that is
aready displayed in a form. Then I assign a new value to
CurrentRowIndex.
The datagrid always scrolls so that the new current row is visible.
However, the vertical scrollbar does not always adjust accordingly.
Upon the first instance of assigning a new datasource and setting the
currentrowindex to the _last_ record, the part of the vertical
scrollbar that can be dragged is happy to move correctly all the way
to the bottom. The newly set current row is visible at the bottom of
the grid.
If I then immediately invoke an instance of assigning a new datasource
and setting the currentrowindex to the _first_ record, the part of the
vertical scrollbar that can be dragged stays stuck all the way at the
bottom. The newly set current row is correctly visible at the top of
the grid.
I've tried various things with datagraid.VertScrollBar.Update(),
datagrid.Invalidate(Me.VertScrollBar.Region) and datagrid.refresh to
no avail.
The above sequence is part of a custom sort operation and happens when
sorting a column ascending and then immediately sorting the same
column descending. The same row is moving to either first or last in
the grid depending on the direction of the sort.
Anyone heard of this or know how to fix it?
Thanks,
Gene H.
aready displayed in a form. Then I assign a new value to
CurrentRowIndex.
The datagrid always scrolls so that the new current row is visible.
However, the vertical scrollbar does not always adjust accordingly.
Upon the first instance of assigning a new datasource and setting the
currentrowindex to the _last_ record, the part of the vertical
scrollbar that can be dragged is happy to move correctly all the way
to the bottom. The newly set current row is visible at the bottom of
the grid.
If I then immediately invoke an instance of assigning a new datasource
and setting the currentrowindex to the _first_ record, the part of the
vertical scrollbar that can be dragged stays stuck all the way at the
bottom. The newly set current row is correctly visible at the top of
the grid.
I've tried various things with datagraid.VertScrollBar.Update(),
datagrid.Invalidate(Me.VertScrollBar.Region) and datagrid.refresh to
no avail.
The above sequence is part of a custom sort operation and happens when
sorting a column ascending and then immediately sorting the same
column descending. The same row is moving to either first or last in
the grid depending on the direction of the sort.
Anyone heard of this or know how to fix it?
Thanks,
Gene H.