c# - RadGrid 底部的水平滚动空白

标签 c# asp.net .net telerik

我正在使用 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;');
}

关于c# - RadGrid 底部的水平滚动空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13589557/

相关文章:

c# - 使用多个 http 请求-响应

c# - Resharper 代码完成工具提示未显示

c# - .NET 核心蓝牙

javascript - UpdatePanel 内的标签不会显示从代码隐藏分配的值

c# - LINQ 查询除了不起作用,List<long?> 与 List<long>

c# - 是否有将模型转换为 View 模型的快捷方式?

asp.net - ASP.NET MVC 中过去的 Cookie 过期日期

asp.net - 如何从 Sitecore 中的另一个子布局访问子布局控件?

c# - Unity3D : Cannot change scripting backend to . 网络

c# - 为什么使用 System.Data.Entity 只需要引用 Entity Framework ?