Hi,
I have a grid which has a mixture of fixed header widths and others as follows:
Now when the grid is populated with data that means that a row is wider than the container a horizontal scroll bar is added. When the scroll bar is scrolled over to the right to see the rest of the row, the column headers do not scroll with the data.
I have a grid which has a mixture of fixed header widths and others as follows:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" OnItemDataBound="RadGrid1_ItemDataBound" |
GridLines="None" OnNeedDataSource="RadGrid1_NeedDataSource" AllowSorting="True" |
ShowGroupPanel="True" Height="100%" Width="100%" AccessKey="G" AllowPaging="True" |
PageSize="5" ShowStatusBar="True" EnableLinqExpressions="False" OnPreRender="RadGrid1_PreRender"> |
<ExportSettings IgnorePaging="true" OpenInNewWindow="true"> |
<Pdf AllowAdd="false" AllowCopy="true" AllowModify="true" AllowPrinting="true" Author="Anonymous" |
Keywords="None" PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in" |
PageTopMargin="1in" PageTitle="RadGrid export document" Subject="RadGrid Export" |
Title="RadGrid export" /> |
</ExportSettings> |
<ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True" |
EnableRowHoverStyle="True" AllowGroupExpandCollapse="False"> |
<Selecting AllowRowSelect="True" EnableDragToSelectRows="False" /> |
<ClientEvents OnRowContextMenu="RadGrid1_OnRowContextMenuHandler" OnRowDblClick="RadGrid1_OnRowDblClickHandler" |
OnGridCreated="RadGrid1_OnGridCreated" /> |
<Scrolling AllowScroll="True" UseStaticHeaders="True" /> |
<Resizing AllowColumnResize="True" /> |
</ClientSettings> |
<HeaderContextMenu EnableTheming="True"> |
<CollapseAnimation Duration="200" Type="OutQuint" /> |
</HeaderContextMenu> |
<GroupPanel ID="GroupPanel" Style="width: 100%;"> |
</GroupPanel> |
<PagerStyle AlwaysVisible="True" Mode="NextPrevAndNumeric" /> |
<MasterTableView ClientDataKeyNames="ID,IsLocked,IsLockedByMe,CurrentWorkflowActivityName,CurrentWorkFlowActivityTypeID,IsReferenced" |
DataKeyNames="ID,IsLocked,LockedById,UserAction,UserActionDescription,UserActionType,IsActionedByMe,IsReadByMe,InForce,ActionedByMeOn,ExpiryDate,InRedraft,ActionByDate,ActualExpiryDate,StateTypeID,ApprovalComment,ApproveByDate,Status,Approved,ReviewByDate,ReviewComment,Reviewed,IsOrphaned" |
RetrieveAllDataFields="False" Width="100%" GridLines="None"> |
<Columns> |
<telerik:GridButtonColumn ButtonType="ImageButton" Resizable="False" ShowSortIcon="False" |
UniqueName="Icon"> |
<HeaderStyle Width="18px" /> |
<ItemStyle Wrap="False" /> |
</telerik:GridButtonColumn> |
<telerik:GridBoundColumn DataField="Name" HeaderText="Subject" DataFormatString="<nobr>{0}</nobr>" |
UniqueName="Name"> |
<HeaderStyle Width="190px" /> |
<ItemStyle Wrap="False" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="DocRef" HeaderText="Reference" DataFormatString="<nobr>{0}</nobr>" |
UniqueName="DocRef"> |
<HeaderStyle Width="170px" /> |
<ItemStyle Wrap="False" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="Version" HeaderText="Version" DataFormatString="<nobr>{0}</nobr>" |
UniqueName="Version"> |
<HeaderStyle Width="45px" /> |
<ItemStyle Wrap="False" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="EditorName" HeaderText="Editor" DataFormatString="<nobr>{0}</nobr>" |
UniqueName="Editor"> |
<ItemStyle Wrap="False" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="Owner" HeaderText="Owner" DataFormatString="<nobr>{0}</nobr>" |
UniqueName="Owner"> |
<ItemStyle Wrap="False" /> |
<HeaderStyle Width="160px" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="Status" HeaderText="State" DataFormatString="<nobr>{0}</nobr>" |
UniqueName="Status"> |
<ItemStyle Wrap="False" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="InForce" HeaderText="Published" DataFormatString="<nobr>{0:d}</nobr>" |
UniqueName="InForce" Visible="false"> |
<ItemStyle Wrap="False" /> |
<HeaderStyle Width="100px" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="ExpiryDate" HeaderText="Expiry" DataFormatString="<nobr>{0:d}</nobr>" |
UniqueName="Expiry" Visible="false"> |
<HeaderStyle Width="100px" /> |
<ItemStyle Wrap="False" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="UserActionDescription" HeaderText="Action" DataFormatString="<nobr>{0}</nobr>" |
UniqueName="Action"> |
<ItemStyle Wrap="False" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="Rank" HeaderText="Rank" UniqueName="Rank" Visible="False"> |
<HeaderStyle Width="20px" /> |
<ItemStyle Wrap="False" /> |
</telerik:GridBoundColumn> |
</Columns> |
<SortExpressions> |
<telerik:GridSortExpression FieldName="Name" SortOrder="Ascending" /> |
</SortExpressions> |
</MasterTableView> |
<FilterMenu EnableTheming="True"> |
<CollapseAnimation Duration="200" Type="OutQuint" /> |
</FilterMenu> |
</telerik:RadGrid> |
Now when the grid is populated with data that means that a row is wider than the container a horizontal scroll bar is added. When the scroll bar is scrolled over to the right to see the rest of the row, the column headers do not scroll with the data.