Hi, I have a wingrid embedded in a tab pane of a tab control. The wingrid displays data in 4 band levels. When clicking on a column header in the lowest band level, sometimes the wingrid will scroll to the top, causing the user to lose track of where they were. I have attached a short video that demonstrates the problem.
Thanks, Bill
The short video is attached.
Hi,
I've watched the video again and the problem seems to be very specific to a series of steps. I've tried this out in a very simple case with a grid in a Tab Control and three levels of grouping like it appears you have here, but I am unable to reproduce the issue.
My best guess is that this was a bug in an older version of the grid. What version of the grid are you using? I did my testing with 15.1 and the latest service release.
Another possibility is that there's something in your code that is causing the grid to re-position. The obvious way to do that would be to set the ActiveRow, set the FirstRow on the RowScrollRegion, or call ScrollRowIntoView. It could also happen if the grid is re-building the rows collection, which it would do if the grid's DataSource sends a Reset notification. The obvious place to look for these kinds of things would be in the BeforeSortChange or AfterSortChange events, which will fire when you click the column header.
Also, you specifically mentioned that the grid is inside a tab control. That seems unlikely to be a factor, but since you mentioned it - is there some reason you think that's related? Have you tried taking the grid out of the tab control?
If none of that helps, it might be a good idea to put a breakpoint in the BeforeRowRegionScroll event of the grid. Disable the breakpoint, then get the grid into a state where the problem will occur when you click on the column header and enable it and then click the header. Frankly, this is kind've a grasping-at-straws approach, because the call stack will probably show that the scroll started with the grid's Paint event, which doesn't really tell us much, but on the off chance that it's something else, it might be worthwhile and it's something very easy to try.
If that's still no good, we will probably need a small sample project demonstrating the behavior so we can debug it and check it out.
Hello,
Thank you for providing a video. I'll be attempting to reproduce this today. If you happen to have a sample demonstrating this I'd greatly appreciate it. Let me know if you have any additional questions.