I have the following problem: on runtime I am changing the name of the columns caption (the grid is linked to a table and I don't want the user to see their original name). However I have one header caption which is too long - "Total Number of votes" which actually represents an integer not bigger than 4 digits. My question is how I can fix the header caption width ... in my case I want it to appear on two lines?
Asked
Active
Viewed 4,494 times
2 Answers
0
you can add property ItemStyle-Width="your value"
Example for bound field
<asp:BoundField DataField="" HeaderText="" ItemStyle-Width="150"/>

Aghilas Yakoub
- 28,516
- 5
- 46
- 51
-
in that case it works, but because the field name is changed on runtime it automatically fits to it. – Andrey Jul 04 '12 at 09:05
-
Hi Andrey Have you checked with ItemStyle-Width="150" ? – Aghilas Yakoub Jul 04 '12 at 09:06
0
If you want column caption to wrap set column HeaderStyle.Wrap to True.
<dxg:ASPxGridView runat="server">
<Columns>
<dxg:GridViewDataColumn FieldName="Test" VisibleIndex="1" >
<HeaderStyle Wrap="True"/>
</dxg:GridViewDataColumn>
</Columns>
</dxg:ASPxGridView>

Filip
- 3,257
- 2
- 22
- 38