Hi,
In my team, we are developing an application that is using the UltraGrid with ExclusiveColScrollRegions (2 of them) to separate the "Data columns" in the left region and a custom drawn column on the right. We like that feature because we have really to distinct regions with a Separator and 2 separates horizontal scrollbars (one per region). The problem we have now is that we have to integrate the UseFixedHeaders functionality for the "Data columns" in the left region and it doesn't work well at all.
We first tried to make it work in the version 14.2.20142.2092. What happened is that we set the UseFixedHeaders to true, the pins in the column headers simply don't show up, so we can't pin them. However, the solution we tried is to avoid setting the ExclusiveColScrollRegion of the "Data columns" on the left region but keep the ExclusiveColScrollRegion set for the right custom column. By doing that we saw the pins showing up and we could pin and unpin columns. However we had a lot of issues with the Export to Excel feature and the nested rows that were not pinned correctly. Overall, after a lot of tweaking, it was working.
But now we had to pass to the version 17.1 and the behavior is not the same for some reason. With the exact same code we have, if we set the UseFixedHeaders to true, the "Data Columns" in the left region seem to disappear, but if we set them all to Fixed right after setting the UseFixedHeaders to true then we see them with their pin, however it's not something we want.
For us the best and more clean solution would be to continue setting the ExclusiveColScrollRegion of the "Data columns" in the left region and when we set the UseFixedHeaders to see the pins appear in the column headers so we can pin/unpin them, actually it's not the case even with the 17.1 version. I think in that case the export to excel and the nested rows would work correctly without us having to tweak the code and playing with their visibility order.
Thanks
Jean-François Brind'Amour
Hi Mike,
Strangely if the columns are set to Header.Fixed = True explicitly they are shown but fixed. We did try setting and resetting but that wouldnt work too.
Thanks,
Prasad Kamat
So.. you are saying that if you set the Fixed property on the column header explicitly, the column is fixed correctly. It just doesn't show the pin? Or does it show the pin button when it is fixed?
When i set the fixed property explicitly, the column is fixed as expected and the pin is shown as fixed. But we wouldnt want fixed columns by default.
I would also add that once the column is fixed (and so the pin icon is visible and in fixed mode), if we unpin the column then it stays there, which is great. So we thought about a quick fix to pin all the columns then unpin them but it doesn't work, even with us calling the Invalidate at each step.
Jean-François
So once you fixed a column in code, ALL the columns show the pin? Or only the fixed one?
This sounds like there's some kind of timing issue going on there. That the grid is painting at a time when it doesn't think Fixed columns are allowed and then not getting updated when fixed headers are turned on.
Is your application using a background worker thread or creating any other threads?
Invalidate won't do anything in a case like this, but you might try calling Update on the grid at various points instead and see if that works around the issue.