I'm using the following code to dynamically build a ultragrid title:
Me.ugContacts.Text = "Contacts (Records Returned = " + text(0) + " )" + _ Environment.NewLine() + _ " (Records Loaded = " + text(1) + " )"
It works fine but it won't fit in the height of the title row. How can I increase the height of the title row so the text will fit?
Hi,
This works fine for me. What version of the grid are you using? Perhaps you need to get the latest service release.
How to get the latest service release - Infragistics Community
Hi Hi Mike
I'm using version 9.1.20091.2077. You can see that both rows are in the title but the tile is too thin.
Hey Mike
Thanks very much. I tried all suggestions and choose the InitializeLayout event. Works beautifully!!!!
Clay
It looks like the grid only sizes the header to the text the first time it paints. So it works if you set the Text in the Form_Load or constructor of the form or probably in the InitializeLayout event. But if you change it later on, it does not re-adjust the height of the header.
So if you know your header height is always going to be two lines, you can get around this by assigning a 2-line string to the Text of the grid in any of those events and then you can change it later and it will still be two lines.
The grid also appears to recalculate the header height if you change the Font. So another option is, after setting the Text on the grid, give it a little kick like so:
Me.ugContacts.DisplayLayout.Appearance.FontData.SizeInPoints += 1 Me.ugContacts.DisplayLayout.Appearance.FontData.SizeInPoints -= 1
Hi Mike,
I've created a stripped down version of the form. Thanks in advance for your help.
Hm, that's odd. I tested this in v9.1 and it worked just fine for me. Maybe there is some property setting on your grid that is different from mine. Can you duplicate this in a small sample project and post it here so I can take a look?