Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
445
ScrollRowIntoView Not Working
posted

I am using UltraGrid and needs a way to check if a selected row is still in the view region. The reason is when user double-click a row in the first grid, another grid will show up. So I dynamically shrink the first grid to make room for the second grid, which caused that selected row (if it is in the bottom) to be scrolled outside of the view in the first grid. So after resize, I want to check if that selected row in the first grid is still visible. If not, I want to scroll it into the view. I tried to use ScrollRowIntoView as below and it didn't work. Why??

grid1.ActiveRowScrollRegion.ScrollRowIntoView(grid1.ActiveRow);

I also tried to set the FirstRow in ActiveRowScrollRegion and it worked:

grid1.ActiveRowScrollRegion.FirstRow = grid1.ActiveRow;

But that didn't solve my problem since I don't always want to reposition the active row into the top. Instead, I want to first check if the active row has been scrolled outside of view. If so, make the active row the first row in the view. If not, don't do anything since the row is already visible. Can you please help?

Thanks!