Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / Ultragrid column header height with text wrapping enabled

Ultragrid column header height with text wrapping enabled

New Discussion
Prerna Shrivastava
Prerna Shrivastava asked on Sep 30, 2019 1:04 PM

Hi ,

We are using Infragistics version 2019.1. The customer has long header captions in the ultragrid  assigned at runtime and want the grid header text to wrap and  take up only 3 rows height.

I have tried the following 

gc.DisplayLayout.Bands[0].ColHeaderLines = 3;
gc.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True; 

gc.DisplayLayout.Bands[0].ColHeaderLines = 3;
gc.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.False; 

UltraGrid does not seem to apply the ColHeaderLines setting when WrapHeaderText is set.

The customer would like  the header text wrapped and still the ColumnHeader height should not be more than 3 lines.Please find  below screenshot of their requirement.

Can you please guide me to achieve the same in ultragrid.

Thanks and Regards,

Prerna

Sign In to post a reply

Replies

  • 0
    Andrew Goldenbaum
    Andrew Goldenbaum answered on Sep 13, 2019 2:45 PM

    Hello Prerna,

    I have been investigating into the behavior you are looking to achieve, and at the moment, I am a little bit unsure of how you can achieve this requirement, but it will not be by setting ColHeaderLines and WrapHeaderText to true. The reason for this is because these two properties are contradictory. For more information on this, see the verified answer on this forum thread.

    I will be investigating into this behavior a bit further with our development teams to see if I can find a way to achieve the behavior you are looking for in this case. I hope to have more information for you soon.

    Please let me know if you have any other questions or concerns on this matter.

    • 0
      Prerna Shrivastava
      Prerna Shrivastava answered on Sep 17, 2019 4:46 AM

      Hi Andrew,

      Thanks for your response.I will be looking forward to your response with further details for achieving this requirement.

      Best Regards,

      Prerna

      • 0
        Andrew Goldenbaum
        Andrew Goldenbaum answered on Sep 18, 2019 1:33 PM

        Hello Prerna,

        I have been investigating into the behavior you are seeing, and it appears that the only way to achieve this is to essentially set the header height. This cannot be set directly, though, as the header’s actual Height property is read-only. As such, this can be done one of two ways.

        The first is to set the ColHeaderLines property to “3” as you have mentioned that you have tried.

        The second, is to utilize a RowLayout as this will give you access to the actual header size. There is an example of utilizing a RowLayout here, and you can read about wrapping text in it here.

        Please let me know if you have any other questions or concerns on this matter.

      • 0
        Prerna Shrivastava
        Prerna Shrivastava answered on Sep 23, 2019 11:43 AM

        Hi Andrew,

        Thanks, I am able to achieve my requirement using RowLayout here. However, though the  end users are able to increase a data rows height at run time, they are not able to reduce it.

        I am using the following code on grid initialize layout.

        band.RowLayoutStyle = RowLayoutStyle.ColumnLayout;

        e.Layout.Override.AllowColMoving = AllowColMoving.WithinBand;

        band.Override.AllowRowLayoutLabelSizing = RowLayoutSizing.Both;

        band.Override.RowSizing = RowSizing.Free;

        band.Override.AllowRowLayoutCellSizing = RowLayoutSizing.Both;

        foreach (UltraGridColumn uc in band.Columns)

        {

        uc.RowLayoutColumnInfo.PreferredLabelSize = new System.Drawing.Size(0, (int)70);

        uc.RowLayoutColumnInfo.MinimumLabelSize = new System.Drawing.Size(0, (int)1);

        uc.RowLayoutColumnInfo.ActualLabelSize = new System.Drawing.Size(0, (int)70);

        }

        e.Layout.Override.AllowRowLayoutColMoving = Infragistics.Win.Layout.GridBagLayoutAllowMoving.AllowOriginXChange;

        Can you please point out what needs to be changed/added here to allow decreasing the data row sizes?

        Best Regards,

        Prerna

      • 0
        Prerna Shrivastava
        Prerna Shrivastava answered on Sep 25, 2019 6:41 AM

        Hi Andrew,

        Could you or any of your team members please provide your inputs on the above requirement. It is a bit urgent from the customer side and any feedback would be highly appreciated.

        Best Regards,

        Prerna

      • 0
        Andrew Goldenbaum
        Andrew Goldenbaum answered on Sep 25, 2019 1:23 PM

        Hello Prerna,

        I apologize for the delay in my response on this matter.

        I have been investigating into the behavior you are reporting, and have put together a sample project on my end with the code you have provided. In doing so, though, I cannot seem to reproduce the behavior that you are seeing where you are able to increase the size of the rows but not decrease them.

        I have attached the sample project I used to test this.  Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.

        If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using.  My test was performed using version 19.1.20191.150 in Infragistics for Windows Forms 2019 Volume 1.

        If the project does show the product feature working correctly, this indicates a possible problem in the code of your application.  It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.

        Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.

        Please let me know if you have any other questions or concerns on this matter.

        UltraGridRowLayoutSizingDemo.zip

      • 0
        Prerna Shrivastava
        Prerna Shrivastava answered on Sep 26, 2019 11:37 AM

        Hi Andrew,

        Thank you for the response. I tested the project you shared  and see the same behavior as present in my application. I can't reduce the row height .

        The environment details :version 19.1.20191.82 in Infragistics for Windows Forms 2019 Volume 1.

        .net framework : 4.7.2.  – I tested your application with framework 4.6.1 also.

        Visual Studio 2017 and Windows Server 2016 Standard.

        Please let me know if I need to share any other details.

        Best Regards,

        Prerna

      • 0
        Mike Saltzman
        Mike Saltzman answered on Sep 26, 2019 1:18 PM

        Hi Prerna, 

        I ran Andrew's sample and it works fine for me. I ran it using v19.1 and every version I could find all the way back to v16.2. I even tried it on a monitor that's using Dpi Scaling just to be thorough.

        Maybe what you are seeing is a bug that is already fixed. I recommend getting the latest service release. 

        If that doesn't help, then it might be something specific to your machine. Is there anything unusual about your display? What screen resolution are you running? Are you using Dpi Scaling?  

      • 0
        Prerna Shrivastava
        Prerna Shrivastava answered on Sep 30, 2019 12:25 PM

        Hi Mike,

        Thanks for your response.

        I will upgrade to latest service release and get back to you with my findings.

        I see the latest service release for Infragistics for Windows Forms 2019 vol 1 is version 19.1.20191.150. We have many applications on the same development machine which are referencing version 19.1.20191.82 and can't be upgraded at this stage of the project.(deployed to production very recently and same environment needed for issue fixes).

        Can both versions  19.1.20191.150 and 19.1.20191.82 coexist and be referenced on the same machine simultaneously?

        Best Regards,

        Prerna

      • 0
        Mike Saltzman
        Mike Saltzman answered on Sep 30, 2019 1:04 PM

        [quote user=”2B1FADDAE4E86C61E9CD58DB8F5E19675AD38E2C”]Can both versions  19.1.20191.150 and 19.1.20191.82 coexist and be referenced on the same machine simultaneously?[/quote]

        No. You can run multiple major version on the same machine (i.e. 19.1 and 18.2). But you can't run different minor versions on the same machine. Only one can be installed in the GAC at a time. 

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Prerna Shrivastava
Favorites
0
Replies
10
Created On
Sep 30, 2019
Last Post
7 years ago

Suggested Discussions

Tags

No tags

Created by

Created on

Sep 30, 2019 1:04 PM

Last activity on

Sep 30, 2019 1:04 PM