I have successfully implemented column groups in my wingrid via the row layouts. Now that I've done that, I need to freeze the first group (containing the first two data columns) so as I scroll horizontally that group stays put.
I've tried everything I can think of based on what I've found in your forum, but nothing seems to work. Since I have three grouped headings, I had to create two groups for the first two columns. One is the parent of the other. The groups are named GC_Empty and Empty and contain data columns 1 and 2 (column 0 is hidden). So I assumed that I would do one of the following (or both)
1. GC_Empty.Header.Fixed = true;
Empty.Header.Fixed = true;
2. band.Columns[1].Header.Fixed = true;
band.Columns[2].Header.Fixed = true;
Then afterwards: ugManagers.DisplayLayout.Override.FixedCellSeparatorColor = Color.Red;
Thanks in advance,
Paul
Hi Paul,
Fixed headers and RowLayouts are mutually exclusive. There is no way to fix a header in RowLayout mode.
If you have nested groups, then there's not much you can do. But if you are only using a single row of groups with some columns in each group in a flat layout, you could use the normal Groups and levels view (RowLayoutStyle == None).
Hmmmm. I do have two groups. Each has 6 3-column groups under it. Don't know if that qualifies as nested, but I think it might. Could I do this kind of thing without having to use RowLayout? Then I could use the standard group freezing.
Here's what I have:
| Major Group 1 | Major Group 2 |
| Minor Group 1 | Minor Group 2 | Minor Group x | Minor Group 1 | Minor Group 2 | Minor Group x |
|col1 | col2 | col3 | ....
So it looks like I am stuck. I have to use rowlayout because I have nested groups, and I can't implement the ExclusiveColScrollRegion because of it. I have to have multiple groups. That's a part of the requirement.
What can I do then to make the right hand scroll region not show what's in the left side? That MUST have entered in the minds of the developers when they were designing these features.
paul
I changed my program to use regular grouping instead of rowlayout. So now I have two groups on one grouping row, and the scrollregion works.
Could someone in the development department try to figure out a way that you can do scroll region exclusivity with rowlayout grids? Thanks...
Now that I have the scroll region working, I noticed that if I click on the vertical region divider, I am able to click and drag it to the right. Is there a way to turn off this feature? I don't want the users to be futzing with the scroll divider.
That's an easy one:
layout.ColScrollRegions[0].SizingMode = SizingMode.Fixed;
You're right --- that was easy. Couldn't find anything related to that on the various documentation pages, though. Thankfully you knew about it.
I have one more issue. Now that I have scroll regions defined, one of the pieces of functionality that we have on our usage of WinGrid, is the ability to right-click on the grid and perform an "Export to Excel". The underlying code simply runs the following:
private Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter ugExcelExporter;
string fileName = directoryName + "\\Temp" + System.DateTime.Now.Ticks + ".xls";
ugExcelExporter.Export(this, fileName);
System.Diagnostics.Process.Start(fileName);
The problem is alll we get in our exported document is the first scroll region column. I know that the exporting function worked before I added the scroll regions, so there might be something we have to do to make the export work right when there are scrolling regions...
Please let us know if you require further assistance regarding the creating of a fixed grid (Greezing Groups in UltraGrid). We will be happy to assist you further.
Hi,
'ov' is deinfed in the sample code I posted above... it's like 5 posts back.
I don't think there is a PDF version of the docs, but I'm not sure, so I pinged Developer Support to see if they can get you a definitive answer on that.
I didn't have a definition of the object 'ov' so I had to eliminate that from my code. this morning I did a search on it and found out that I needed to do a override call, so I then assumed that 'ov' was a ppointer to the override object that you forgot to include in your code sample.
So now I am all set with everything. thanks so much for all your help.
Is there a place where I can download a complete developers' guide in PDF format? I would be able to find most of what I need if I had that type of document.
I covered that in my previous post.
ov.FixedHeaderIndicator = FixedHeaderIndicator.None;
Mike,
That final response put everything into proper focus. I hadn't noticed that there was a separate "UseFixedHeaders" for the entire WinGrid layout, and then a column-specific band.Groups[0].Header.Fixed = true; In my mind they were one and the same. Compound that with the explanation associated with the ColumnScrollRegion that I found on your forum some where, and to my mind you couldn't have the desired scrolling effect any other way.
I was getting different pointers because you still have documentation about scroll regions. I didn't notice if there was a discalimer about which version it referenced.
I just changed my WinGrid to use Fixed headers and everything works great. I can even export to Excel without any problems.
layout.UseFixedHeaders = true;
band.Groups[0].Header.Fixed = true;
band.Groups[1].Header.Fixed = false;
Finally, is it necessary for the pushpin icons to be along each group? I would rather not have them display since the user won't be switching from fixed to unfixed...
Thanks,