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
100
How to set maxwidth of Group Header Column?
posted

Hello, 

I'm using UltraGrid which version is Infragistics4.Win.UltraWinGrid.v18.1.

I created group header grid and  i need to set the max width size of the first group to do not oversized when grid resizing.

In normal grid ( below codes) , MinWidth and MaxWidth are working.

grid1.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;

grid1.DisplayLayout.Bands[0].Columns["Category"].MinWidth = 25;
grid1.DisplayLayout.Bands[0].Columns["Category"].MaxWidth = 25;

but, in group grid,  MinWidth is set but MaxWidth isn't. ( i tried below codes)

grid2.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;

grid2.DisplayLayout.Bands[0].Groups["Desc"].Width = 225;
grid2.DisplayLayout.Bands[0].Groups["Desc"].Columns["Desc"].MinWidth = 225;
grid2.DisplayLayout.Bands[0].Groups["Desc"].Columns["Desc"].MaxWidth = 225;
grid2.DisplayLayout.Bands[0].Columns["Desc"].MinWidth = 225;
grid2.DisplayLayout.Bands[0].Columns["Desc"].MaxWidth = 225;
grid2.DisplayLayout.Bands[0].Columns["Desc"].Header.Group.Width = 225;

"Desc" Group contains 1 column named "Desc".

How can i set the maxwidth of the group or column in the Group grid ?

Parents
No Data
Reply
  • 960
    Offline posted

    Hello,


    I tried to reproduce your issue by using the code you'd given us, but it wasn't reproduced in my side.
    I attached a sample application I had gavin it a try. Could you run this application and see if the issue is reproduced?

    I tested it in the following steps:
    1. Open the sample application in Visual Studio and run it.
    2. Drag the right border of the window right and left.
    -> Observe whether or not the width of the "Desc" group changes in proportioin to the window's size.

    Result:
    The width of the "Desc" group doesn't change.


    If the application reproduces your issue in your side, then the change in behavior is due to differences in your environment from mine and these differences can be anything from operating system version to the specific version of the Infragistics DLL versions used.  My test was performed using version 18.1.20181.396 in 2018 Volume 1.  Please provide more details about your machine and version of the assemblies that you are referencing so that I can modify the environment that I am testing in to match yours.

    If the application doesn't reproduce your issue in your side, then more information will be needed to reproduce the issue in a sample that can be used for debugging.  It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.  This can be done by either making the sample that I provided more like your application or by isolating the behavior from your application by removing dependencies on any third parties or databases.

    Please let me know if I can provide any further assistance.

    2664.WindowsFormsApplication1.zip

Children
No Data