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?
Hello Rashi,
Thank you for contacting infragistics support.
It looks like we didn’t get much vote for this request and that is why this product idea has never been implemented.
Please let me know if you need further assistance on this matter.
Hello Divya,
I want to fix header's height so that it can accommodate max. 2 lines of text. And as mentioned in the above question 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. Is there any way to do it?
As I described this is still a new product idea for infragistics.
The lease you could do is to set the width of the column and set WrapHeaderText to true this way every time when header text reach to column width it goes to the next line.
Something like this:
this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].Width = 80;
this.ultraGrid1.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True;
Please let me know if you need further assistance on this matter .
It is not the width that I want to set the maximum value for, but the height. I want the height of the header, such that it can accommodate max. 2 lines of text. Is there any way to do the same while keeping the value for WrapHeaderText to true?
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.