Hi,
We have a strange issue with the HeaderStyleDefault.Wrap property. This value is set to true as follows;
<HeaderStyleDefault BackgroundImage="/ig_common/images/Themes/Aero/grid_header_bg.jpg"
BorderStyle="None" Cursor="Hand" Font-Bold="True" Font-Names="Trebuchet MS,Verdana,Arial,sans-serif"
Font-Size="X-Small" ForeColor="#555555" Height="23px" HorizontalAlign="Left" Wrap="true">
<BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
<Padding Left="5px" />
</HeaderStyleDefault>
However, the column header text only wraps if a postback event has occured. If the grid is created when the page is first loaded the text never wraps.
We have also tried setting the wrap value to true within various stages of the page lifecycle such as CreateChildControls, OnIt, PageLoad and also the Infragistics event UltraWebGrid1_InitializeLayout.
We presume the problem is due to the grid not knowing the width of the columns until it has been created, but thats a total guess.
Does anyone else use this feature?
Found the problem;
The first time the grid is rendered (i.e not a postback) the font size set in HeaderStyleDefault within the .aspx is used as the font size. If a postback occurs (i.e. you click on the sort) this size is overriden by the UltraGrid internally ensuring that the text fits within the column width.
Cheers
Russ
Quick update,
The column headers are wrapping but the font size is changing between first load and postback. If I hardcode the font size within the code behind then it stops the same.
Hi Jarrad,
Thanks for taking the time to reply.
I have tried setting the column headers individually as you suggested but they still only wrap on a postback.
Where in the page life cycle do you set the headers to wrap. At the moment I'm iterating the columns straight after I had called DataBind;
//bind to the data source
this.UltraWebGrid1.DataBind();
{
}
Thanks again
I do use that feature, but go about it differently. I'm not sure if this will help you, but I'll pass it along anyway.
I wrap the columns in the code behind column by column.
gridname.Columns.FromKey("RowName").Header.Style.Wrap = True
This has always worked.
Good Luck!