Hi,
Title has a typo...
How to set column width to fit, when UseStaticHeaders="true"
I have a RadGrid which likes this:
<telerik:RadGrid ID="CRMGrid" runat="server" AllowSorting="true" GridLines="None" OnSortCommand="CRMGrid_SortCommand" OnItemDataBound="CRMGrid_ItemDataBound" AllowMultiRowSelection="true" OnSelectedIndexChanged="CRMGrid_SelectedIndexChanged" ShowHeader="true">
<HeaderStyle Width="100px" />
<ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
<Selecting AllowRowSelect="true" />
<Scrolling AllowScroll="True" UseStaticHeaders="true" FrozenColumnsCount="1"/>
</ClientSettings>
<SelectedItemStyle CssClass="SelectedItem" />
<MasterTableView Font-Names="Arial,sans-serif" TableLayout="Auto">
<Columns>
<telerik:GridClientSelectColumn>
<HeaderStyle Width="35" />
<ItemStyle Width="35" />
</telerik:GridClientSelectColumn>
</Columns>
<CommandItemSettings ShowExportToCsvButton="true" />
<HeaderStyle Font-Bold="true"/>
</MasterTableView>
</telerik:RadGrid>
If UseStaticHeaders="true", then header and content are in 2 <div> and 2 <table> tags, table layout is fixed and column width can NOT be fit to max length of cell content. See picture 1.
If UseStaticHeaders="false", then header and content are in same div and table, column width is auto-fit, but header disappears when scroll down.See picture 2.
Any suggestion?
Thanks a lot.
Zhenyu Wang
Title has a typo...
How to set column width to fit, when UseStaticHeaders="true"
I have a RadGrid which likes this:
<telerik:RadGrid ID="CRMGrid" runat="server" AllowSorting="true" GridLines="None" OnSortCommand="CRMGrid_SortCommand" OnItemDataBound="CRMGrid_ItemDataBound" AllowMultiRowSelection="true" OnSelectedIndexChanged="CRMGrid_SelectedIndexChanged" ShowHeader="true">
<HeaderStyle Width="100px" />
<ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
<Selecting AllowRowSelect="true" />
<Scrolling AllowScroll="True" UseStaticHeaders="true" FrozenColumnsCount="1"/>
</ClientSettings>
<SelectedItemStyle CssClass="SelectedItem" />
<MasterTableView Font-Names="Arial,sans-serif" TableLayout="Auto">
<Columns>
<telerik:GridClientSelectColumn>
<HeaderStyle Width="35" />
<ItemStyle Width="35" />
</telerik:GridClientSelectColumn>
</Columns>
<CommandItemSettings ShowExportToCsvButton="true" />
<HeaderStyle Font-Bold="true"/>
</MasterTableView>
</telerik:RadGrid>
If UseStaticHeaders="true", then header and content are in 2 <div> and 2 <table> tags, table layout is fixed and column width can NOT be fit to max length of cell content. See picture 1.
If UseStaticHeaders="false", then header and content are in same div and table, column width is auto-fit, but header disappears when scroll down.See picture 2.
Any suggestion?
Thanks a lot.
Zhenyu Wang