I have three header lines: One header group with a subgroup and the columns under the subgroup. This configuration is described in this thread:
http://community.infragistics.com/forums/p/62335/315930.aspx#315930
The problem I have, is to align the height of this 3 group header lines to the height of the header line of a second grid. The second grid has no groups configured, it has multiline header of 3 lines.
Is that possible, that both grid have the same header height?
Thanks. Markus
Hi Markus,
I think this should be possible if I understand you correctly. You can control the size of the headers using the column.RowLayoutColumnInfo.PreferredLabelSize.
Hello Mike,
I have tried this, but it seems not much change. I was not able to paste a picture here (see attached file)!?
At the pic you see the standard view on the left, where each cell is one day. The grid right should show a detailed view of one day. One cell stands for 15 minutes. Therefore all header and rows should be in synch to look nice. Even if some rows are added to the standard grid. Both grids have 3 bands (top band with departments, second with employees and duties, third not used yet). The headers are set and visible for the top band only.
How getting the Height of one header line of the standard view (this grid has 3 header lines at Band[0] as you can see) ?
int headerHeightStandard = this.GridStandard.DisplayLayout.Bands[0].Header.Height;
Using this value to set the first group (SpanY=2 must be 2/3 of the standard header height). But this has no effect
groupOrg.RowLayoutGroupInfo.PreferredLabelSize = new System.Drawing.Size( 150, headerHeightStandard * 2 / 3 );
And for the day group:
groupDay.RowLayoutGroupInfo.PreferredLabelSize = new System.Drawing.Size( 24 * 4 * 10, headerHeightStandard / 3 );
And similar to the other groups. Furthermore the row height of all rows decreases if setting the RowLayoutStype = GroupLayout.
Can you give me some example code?
Regards. Markus
It's hard for me to offer you specific advice here, because there are just so many variables.
Are both of these grids using RowLayoutStyle.ColumnLayout?
Which headers are you trying to use as the base height and which ones are you trying to change?
Since you have multiple rows of headers in the second grid, it will be tricky to get all of the PreferredLabelSizes correct so that everything matches up. You will probably need to set the PreferredLabelSize on every column, not just one.
I believe that's hard for you. I probably use the grid for somewhat not very common but I could fix some problems now. I have found some forum threads and help sources around this.
Getting the header height of the grid with 3 header lines in ColumnLayout (left grid):
int totalHeaderHeight = this.GridStandard.DisplayLayout.Bands[0].TotalHeaderHeight;
Allowing to label sizing:
band0.Layout.Override.AllowRowLayoutLabelSizing = RowLayoutSizing.Both;
Setting the sizes:
group.RowLayoutGroupInfo.MinimumLabelSize = new System.Drawing.Size( 1, 1 );group.RowLayoutGroupInfo.PreferredLabelSize = new System.Drawing.Size( 150, totalHeaderHeight / 3 );
Setting default row height to both grid the same:
e.Layout.Override.DefaultRowHeight = rowHeightStandard;
Setting all this, my grids are aligned perfectly (see the screenshot attached).
Using GroupHeaders, how can I disable column-width and row-height sizing?
Normal 0 21 false false false DE-CH X-NONE X-NONE
Initialize_Layout:
e.Layout.Override.AllowColSizing = AllowColSizing.None;
This seems to have no effect. When moving the cursor over the group headers, it changes to arrow cursor and column and header-rows can still be sized.
How can this be disabled?
Thank you. Markus
AllowColSizing only applies to columns and it's really for non-RowLayouts. There are separate properties for ColumnLayout and GroupLayout styles.
e.Layout.Override.AllowRowLayoutLabelSizing = RowLayoutSizing.None;
You may need to set AllowRowLayoutCellSizing, also.
Hi Mike,
Yes I know these settings but since I need label sizing to align the header height to my second grid, I can not use this? See my last post.
Are there any other properties to use or maybe a workaround using some canceleable events before sizing?
It doesn't matter either way. The AllowRowLayoutLabelSizing (and in general all of the "Allow*" properties only determine if the user can make changes. Changes you make in code are not affected.
Sorry Mike, I got it.
After Initialize_Layout I can disable label sizing :-).