Hi,
I could not find a property to set the header height for a column set. Please suggest how to do this?
Thanks
spm
In the normal mode, you have to use ColHeaderLines to set the number of lines of text, you can't set a Height. In RowLayout mode, you would need to set the PreferredLabelSize (I think) on the RowLayoutColumnInfo of the column.
Hi Mike,
Thanks for your reply.
I have set WinTree's ViewStyle property to FreeForm and I am dynamically binding the nodes collection to multiple tables based on the parent node. This creates a hetergenous hierarchical structure with many column headers, though this headers are necessary they seem to occupy much of the screen space. Since hiding the headers is not an option in my case, I was wondering whether the hieght of column headers could be reduced in any way. I understand that there is no direct way of doing this, but I was hoping for any workaround. Please suggest.
Thanks in advance,
Hi spm,
There is a direct way. My answer above was actually more about WinGrid than WinTree. But WinTree is basically like a grid in RowLayouts mode. The column in the ColumnSet must expose a PreferredLabelSize property so you can adjust the size of the labels.
If you are creating the ColumnSets yourself, then you can do it when you create them. If you are letting the tree automatically generate them, then you could do this in the ColumnSetGenerated event.
Alas, you are 100% correct. I tried setting it to 6 or 7... bingo.
Thanks again!
The default font size is probably 8 or 9, so setting the HeaderAppearance.FontData.SizeInPoints to 8 does not make any noticeable difference. I tried setting it to smaller values and the header height decreased accordingly. We have logic in place that prevents the header's height from becoming to small to show the text; if you like you can submit a feature request for the ability to remove that safeguard via a property setting.
Mike,
No matter what I do, I cannot get the Height of my tree-grid column header to decrease below the default. I can get it to increase (header is taller).
....ColumnSet.Columns["Name"].LayoutInfo.PreferredLabelSize = new Size(100, 15);
I've tried changing the font also...
....ColumnSet.Columns["Name"].HeaderAppearance.FontData.SizeInPoints = 8;
..doesn't seem to matter. It seems I'm stuck with these enormous column headers. Sure wish they were smaller.
....ColumnSet.AllowCellSizing = LayoutSizing.Both;
....ColumnSet.AllowLabelSizing = LayoutSizing.Both;
My tree is using the Grid style.
Help?