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
1660
How to increase header height in Ultragrid ?
posted

Hi,

Scenario 1:

I have an ultragrid in my application as shown below.

I have increased the row height. Please refer the screen shot.

400

Scenario 2:

I have modified the same grid by increasing header height by setting the property colheaderlines to 2. Please refer the image given below.

What I would like to have is, instead of setting colheaderlines, I would like to set height in pixels or points.

Could someone help in finding a solution for this ?

It would be great, if solution is given as a sample project.

Thanks.

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi, 

    As mentioned, the only way to set the header height to a specific pixel value is to use RowLayouts. To achieve that, you would do something like this: 

            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                var layout = e.Layout;
                var band = layout.Bands[0];
                var ov = layout.Override;
    
                band.RowLayoutStyle = RowLayoutStyle.ColumnLayout;
                // Assuming that none of the other columns PreferredLabelSize is set
                // you can simply set the height of one of them to affect all headers
                // in the band. 
                band.Columns[0].RowLayoutColumnInfo.PreferredLabelSize = new Size(0, 100);
            }

    This might be a good solution for you, but you should be aware that using RowLayouts will carry with it certain changes to how the grid looks (you might notice a different in spacing or padding of cells) And also and certain limitations - using RowLayots this will disable Fixed (column) Headers, as fixed headers and RowLayouts are mutually exclusive. If you are not using Fixed Headers, anyway, then this is probably a good way to go. 

Children
No Data