Hi,
I'm trying to create a multi-group grid, using the UltraGridGroup.
What I'm trying to do is a table that looks like this:
AAA | BB |
XX | YY | XX | YY |
1 | 2 | 1 | 2 | 1 | 2 | 3 | 4 |
<table values>
I hope it is clear, if not, I'll try to describe in words:
Original column names are build from 3 'groups': A, B and C (for example AAA@@@XX@@@1).
The final grid should show property A in the first group, property B in the second group and property C in the third group (and after that, the actual values).
I've tried to use the UltraGridGroup, but the problem is that I can't connect a group to another group, so it doesn't work - one of the groups is displayed as a 'new column', because it doesn't have any column related to it (seeting a column for groupB remove this column from groupA).
How can I do what I'm trying?
You can't do this in the standard RowLayoutStyle. There's no way to do nested groups in that style.
You can do this using RowLayouts. If you have the latest version of the grid, then you can have nested groups. If you have an older version, before the RowLayoutStyle property was added, then you could still do something like by using columns with no cells to simulate the group headers. But the best way would be to use the RowLayoutStyle of GroupLayout which lets you have nested groups.
I have an old version of the Grid (V7.2), so I guess I won't be able to use 'nested groups', but I do see the RowLayoutStyle property.
Could you provide more details on a solution?
v7.2 does not have RowLayoutStyle. I suspect you might be looking at the RowLayoutLabelStyle, which is not the same thing.
In v7.2, you could use RowLayouts by setting UseRowLayouts to true. Then what you could do is create an unbound column and set it's RowLayoutColumnInfo.LabelStyle to LabelOnly. This will give you a column header with no cells. You could then place this column and set it's Spans so that it looks like a group header. It will not act as a real group, you won't be able to click and drag to move the group with it's child groups and columns as a whole, but it will give you the look you have shown here.
eligazit said: I could not find LabelStyle property on the RowLayoutColumnInfo object. The closest thing I've found was on Band - RowLayoutLabelStyle, did you meant this property?
I could not find LabelStyle property on the RowLayoutColumnInfo object.
The closest thing I've found was on Band - RowLayoutLabelStyle, did you meant this property?
Oops, sorry about that, I got mixed up. The property is called LabelPosition.
eligazit said:Could you give some simple code example on how to get started?
Setting up a RowLayout in code is going to be pretty difficult and complex. It's a lot easier to do this in the grid designer. This requires you to either have the grid bound to the data source at design-time or else to set up the grid's data structure manually at design-time so that the grid has columns to work with.
Could you give some simple code example on how to get started? In the help for RowLayoutStyle
(http://help.infragistics.com/Help/NetAdvantage/WinForms/2009.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v9.2~Infragistics.Win.UltraWinGrid.UltraGridBand~RowLayoutLabelStyle.html)
The created grid contains 2 column levels (and I need 3), and also, each row with data contain 2 rows, which is not what I need (I need only one row with the data.