UltraGrid - UseFixedHeaders and ExclusiveColScrollRegion at the same time

Answered (Not Verified) This post has 0 verified answers | 10 Replies | 3 Followers Thread's RSS feed.

Jean-François
Points 155
Replied On: Mon, Aug 21 2017 11:00 AM Reply

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

  • Post Points: 20

All Replies

Mike Saltzman
Points 465,670
Infragistics Employee
Answered (Not Verified) Replied On: Mon, Aug 21 2017 4:05 PM Reply
Suggested by Mike Saltzman

Hi Jean-François, 

I tested this out with a small sample project (which I have attached here). At first, I tried setting the ExclusiveColScrollRegion on every column in the grid - some in the first ColScrollRegion and some in the second.  I tried this out in 12.2, 14.2, and 17.2 and the behavior is the same in all cases. Once I assign an ExclusiveColScrollRegion to a column header, that column will not show the pin button nor will the grid allow me to fix that header. 

As far as I am able to determine - Fixed headers are not supported on any column which is assigned an ExclusiveColScrollRegion - and that has always been the case. 

It sounds like you only need to fix columns in the left-most ColScrollRegion, though. So if I set ExclusiveColScrollRegion on just the column I want in the right-side ColScrollRegion, everything seems to work okay for me. Once again, I tried this out in the same three versions and it seems to work for me. I'm not seeing any problem with the columns in one scrollregion disappearing. 

I have attached the sample project I used here so you can run it and see if you get the same results. If my sample works for you, then there must be some other factor at work in your application and we will need to figure out what that is. Maybe you can modify my sample so that it reproduces the issue you are seeing. 

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 20
Jean-François
Points 155
Replied On: Mon, Aug 21 2017 4:20 PM Reply

Hi Mike,

Thanks for the fast reply. That's what I thought and it was exactly the way I was trying to make the fixed headers work for the "Data columns" in the left region. We also created a small demo on our side and as you said the pins are shown correctly when the columns in the left region are not set to an ExclusiveColScrollRegion even with version 17.1. I guess we will have to dig in our application code to see what is different from the demo and then, if we find the culprit we will get back to you with what we found.

Thank you!

Jean-François Brind'Amour

  • Post Points: 20
Mike Saltzman
Points 465,670
Infragistics Employee
Replied On: Mon, Aug 21 2017 5:18 PM Reply

Is it possible that you made changes other than just upgrading to a new version? 

Fixed headers are also not supported if you set the RowLayoutStyle to ColumnLayout or GroupLayout. So that would be one obvious thing to check. 

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 20
Jean-François
Points 155
Replied On: Tue, Aug 22 2017 9:55 AM Reply

Hi,

I tested and we never set the RowLayoutStyle unfortunately, the default we use is None. However we have multiple bands hierarchy, one main band and children bands. Might it be the problem ? It worked well though with the first version we tried. We will dig into the code today by removing the most of the code we can to see how to make it work like the demo.

Thanks

Jean-François Brind'Amour

  • Post Points: 35
Mike Saltzman
Points 465,670
Infragistics Employee
Replied On: Tue, Aug 22 2017 11:04 AM Reply

I can't see any reason why having hierarchical data should make any difference.

If the behavior did change between versions, then that's clearly a bug and it's something we need to look into. But we can't do that, of course, unless we can reproduce the issue first. While I was creating my sample, I look into the code a little and there were only two reasons I could see in the code why the pin buttons would not display when UseFixedHeaders is turned on. One is if the column header's ExclusiveColScrollRegion is set and the other is if you set RowLayoutStyle. 

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 5
Prasad
Points 40
Replied On: Tue, Aug 22 2017 11:07 AM Reply

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

  • Post Points: 20
Mike Saltzman
Points 465,670
Infragistics Employee
Replied On: Tue, Aug 22 2017 1:14 PM Reply

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? 

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 20
Prasad
Points 40
Replied On: Tue, Aug 22 2017 1:35 PM Reply

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. 

  • Post Points: 20
Jean-François
Points 155
Replied On: Tue, Aug 22 2017 1:45 PM Reply

Hi,

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.

Thanks

Jean-François

  • Post Points: 20
Mike Saltzman
Points 465,670
Infragistics Employee
Replied On: Tue, Aug 22 2017 4:36 PM Reply

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.

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 5
Page 1 of 1 (11 items) | RSS