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
245
Column width expanding
posted

Hi,

When I set a column width it doesn't always set correctly. I am setting the UltraGridColumn.Width for each column in each band. I am using an older version of the grid, v6.2 but what I'm trying to do is very basic. 

Is this a known issue? Or am I doing something wrong?

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    There are a number of reasons why this might not work the way you are expecting it to.

    By default, the column widths are synchronized across all bands. So when you set the width of the first column in the root band and then set the width of the first column in the child band, the root band column width is changed along with it.

    To allow the columns width to be set freely, do this:


            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                UltraGridLayout layout = e.Layout;
                UltraGridOverride ov = layout.Override;

                ov.AllowColSizing = AllowColSizing.Free;
            }

    Another possibility is that you have AutoFitStyle turned on, which automatically adjusts the widths of the columns so that they fit within the visible area of the grid. This, of course, means that changing the width of any one column will change the width of every other column. The only way around that is to turn off AutoFitStyle.

Children