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
20
Set maximum header height in ultraGrid while WrapHeaderText is true
posted

I have set the 'Colheaderlines' to '2' and 'WrapHeaderText 'to 'true'. What I want is for it to wrap the text onto the next line if it don't fit in single line. However, if the text don't fit in two lines as well, then it should truncate the text. I found one similar question. Following is the link for same:

https://www.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/74096/column-header-maximum-lines

Under this I see that solution for this has been taken up as a product idea. Could you please tell if that has been implemented or is there any other workaround for the same?

Parents Reply
  • 7315
    Offline posted in reply to Rashi

    MemDataTable CS.zip

    Hello,

    Thank you for the update.

    Using WrapHeaderText to set the height of the header up to two line is still a product idea.

    But to achieve the same requirement I found an another workaround which is using property ColHeaderLines = 2 and then draw the text yourself using a DrawFilter. Please note this approach would work if you are not Autosizing the columns.

    Your code would be something like this :

    this.ultraGrid1.DrawFilter = new MyDrawFilter();

    band.Columns["HeaderName"].Header.Caption = "This is some long text that probably needs to wrap because it's just so long.";

    band.ColHeaderLines = 2;

    I have attached a sample project I used to test this.

    Please find the attached sample and let me know if you need further assistance on this matter.

Children
No Data