Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2005
Programmatically change column header height
posted

Hi,

I am trying to set the column header height programmatically:

ultraGrid.DisplayLayout.Bands[0].RowLayoutStyle = RowLayoutStyle.ColumnLayout;
ultraGrid.DisplayLayout.Override.AllowColMoving = AllowColMoving.WithinBand;
ultraGrid.DisplayLayout.Override.RowSizing = RowSizing.Fixed;

...

ultraGrid.DisplayLayout.Bands[0].Columns[0].RowLayoutColumnInfo.PreferredLabelSize = new System.Drawing.Size(0, (int)_columnHeaderHeight);

The column header height is set to the height correctly. However, this gives me two issues:

1. The column header height can be changed by user. Is there a way to disable this? 

2. The column headers can be dragged into multiple rows of headers. User is only allowed to drag a column to a different position horizontally.

Thanks,

Shaolin

  • 1225
    Verified Answer
    Offline posted

    Hi Shaolin,
    You can set the LayoutLabelSizing and LayoutColMoving properties in the Grid Override to disable the Label sizing and Column moving vertically.
    ultraGrid.DisplayLayout.Override.AllowRowLayoutLabelSizing = RowLayoutSizing.Horizontal;
    ultraGrid.DisplayLayout.Override.AllowRowLayoutColMoving = Infragistics.Win.Layout.GridBagLayoutAllowMoving.AllowOriginXChange;

    Thanks,
    Josheela