我正在使用 RadGrid 从数据库检索数据。我的 RadGrid 中有更多列,因此我需要显示 RadGrid 水平滚动以防止页面扩展,但禁用垂直滚动,因此网格的高度应扩展以始终显示网格中的所有行。我得到了结果,但 RadGrid 底部有空白。
我的 RadGrid 用户界面:
<table style="table-layout: fixed;" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="false" PagerStyle-AlwaysVisible="true"
CellPadding="0" CellSpacing="0" GridLines="None" Skin="Metro" CssClass="RadGrid_CBGrid"
HorizontalAlign="Left" AutoGenerateColumns="False" OnItemCommand="RadGrid1_ItemCommand"
OnDataBound="RadGrid1_DataBound">
<ClientSettings>
<Selecting CellSelectionMode="SingleCell"></Selecting>
<Scrolling AllowScroll="true" UseStaticHeaders="True"></Scrolling>
</ClientSettings>
<MasterTableView HierarchyLoadMode="Client" DataKeyNames="EmpID" AllowMultiColumnSorting="true"
Name="Parent">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
</RowIndicatorColumn>
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
</ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="EmpID" EmptyDataText="NA" HeaderText="Emp ID"
UniqueName="EmpID">
</telerik:GridBoundColumn>
and so on......
-------------------
</Columns>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
</EditColumn>
</EditFormSettings>
</MasterTableView>
<FilterMenu EnableImageSprites="False">
</FilterMenu>
</telerik:RadGrid>
</td>
</tr>
</table>
如果我在 RadGrid 中更改了 ClientSettings-Scrolling-AllowScroll="true" 并
我得到了结果,RadGrid 底部没有空白,但水平滚动条没有出现在我的 RadGrid 中。
那么有人可以给我解决方案吗?
或者,如果您不想担心身高计算,请执行此操作!
// radgrid scroll horizontal only
<ClientSettings AllowDragToGroup="True" AllowGroupExpandCollapse="true">
<Scrolling AllowScroll="true" />
<ClientEvents OnGridCreated="GridCreated" />
</ClientSettings>
function GridCreated(sender, args) {
$('.rgDataDiv').removeAttr('style');
$('.rgDataDiv').attr('style', 'overflow-x: scroll;');
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)