Hi All,
I'm just wondering if there is a method ScrollToView for UltraWinGrid control(I'm pretty sure there is such a method implemented in UltraWebGrid) ?
What I'm trying to do:
I have an UltraWebGrid and an ExpandableGroupBox, sharing same area horizontally. On DoubleClick event on UltraWebGrid item, ExpandableGroupBox becomes expanded and hides some part of UltraWebGrid, which actually can contain an ActiveRow.
How to make an ActiveRow to appear on the visible area of UltraWebGrid (for Ex.: automatically scroll to ActiveRow) ?
Thanks a lot!
Serhiy Kozhevnikov said:I call this method after grid.SizeChanged event is fired. The height of the UltraGrid is changed from 600 to 150. If an ActiveRow is located on the bottom of control, it becomes not visible. Seems like the method ScrollRowIntoView uses the old height value.
My guess is that this is a timing issue and that although the grid's Size has been updated, the grid hasn't yet painted the rows, and recreated the UIElements.
In such a case, your solution it a good one.
You could also try forcing the grid to refresh in the SizeChanged event before you call ScrollRowIntoView. But your solution is probably better.
Your solution looks good to me.
First, thank You : the answer is completely correct.
There is following problem, I faced using .ScrollRowIntoView with version 9.2:
I call this method after grid.SizeChanged event is fired. The height of the UltraGrid is changed from 600 to 150. If an ActiveRow is located on the bottom of control, it becomes not visible. Seems like the method ScrollRowIntoView uses the old height value.
My solution to this now is to scroll an active row to the top of visible area:
ultraGrid.ActiveRowScrollRegion.FirstRow = ultraGrid.ActiveRow;
Are there any other suggestions?
grid.ActiveRowScrollRegion.ScrollRowIntoView(row);