How do you make the activerow or selected rows visible on the grid after the data has been sorted?
Thanks
Hi,
I was under the impression that the grid automatically keeps the ActiveRow in view when the user sorts a column. But maybe I am wrong.
You can bring a row into view like so:
this.ultraGrid1.ActiveRowScrollRegion.ScrollRowIntoView(this.ultraGrid1.ActiveRow);
I'm trying to do this same thing, using the Ultragrid.ActiveRowScrollRegion.FirstRow property.
save the firstrow index
re-sort grid
restore the firstrow index
However, it seems there is a timing issue with the sort and the setting of the firstrow. I think they restore line is being run too soon after the re-sort line. The grid probably is not done "sorting" and the firstrow is not restored. If I add a breakpoint before the restore line, my code works fine.
What I want to know is if there is some grid event that tells us that the grid is done sorting and ready for use?
You may be right, the sort may be done asynchronously. If that's the case, you should use a BeginInvoke to call a method which sets the FirstRow, rather than calling it directly. That will allow time for the sort to complete.