带有bootstrap的asp.net。表格响应滚动在面板体中被破坏

时间:2016-07-28 02:20:23

标签: asp.net twitter-bootstrap

我有一个包含以下HTML的网页:

<div class="panel panel-primary" style="width:auto;height:auto;">
    <div class="panel-heading" id="ContentHeader" runat="server" style="width:auto;height:auto;">Table</div>
    <div class="panel-body" runat="server" style="width:auto;height:auto;">
        <div class="table-responsive">
            <asp:GridView ID="ExcelContentView" runat="server" class="table table-bordered" >
            <HeaderStyle CssClass="info" />
            </asp:GridView>
        </div>
    </div>
</div>

我参考this pages answer.

使用overflow-x可以正常

enter image description here

但是,当溢出-x溢出时,滚动条会被破坏。

约53行15列:

enter image description here

垂直滚动条无效。 但左或右键是移动滚动条。 点击滚动条我想是坏了。

如何修复溢出x和y情况下的滚动条?

这里有额外的c#代码

页面加载

    {
        ExcelContentView.DataSource = ExcelViewManager.Instance.GetExcelViewTable(fileName, historyNum);
            ExcelContentView.DataBind();

    } // method 

和GetExcelViewTable方法

    {
        DataTable stringTable = new DataTable();

        var currType = GameDataFileManager.Instance.GetTypeFromFileName(fileName);

        string historyPath = GameDataFileManager.Instance.GetHistoryPathByType(currType);

        string fullPath = historyPath + fileName + revNum + ".xlsx";

        FileInfo excelFileInfo = new FileInfo(fullPath);

        ExcelPackage excel = new ExcelPackage(excelFileInfo);

        var workSheet1 = excel.Workbook.Worksheets.First();

        int colCount = 0;

        //  
        for (int iCol = 1; iCol <= workSheet1.Dimension.End.Column; ++iCol )
        {
            stringTable.Columns.Add( workSheet1.Cells[1, iCol].Text, typeof(string) );
            ++colCount;
        } // for 


        for (int iRow = 3; iRow <= workSheet1.Dimension.End.Row; ++iRow )
        {
            List<object> objList = new List<object>();

            for (int iCol = 1; iCol <= workSheet1.Dimension.End.Column; ++iCol )
            {

                objList.Add( workSheet1.Cells[iRow, iCol].Text );
            } // for 

            int objCount = objList.Count;

            if (colCount != objCount)
            {
                DotNetMsgBox.Show("Debug");
            }

            stringTable.Rows.Add(objList.ToArray());

        } // for 

        return stringTable;
    }

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。

使用simple sidebar

时,

表格响应是滚动条损坏

此代码时响应中断。

.sidebar-nav > .sidebar-footer {
    display: block;
    text-decoration: none;
    color: #fff;
    position: fixed;
    height: 100px;
    bottom: 0;
    width: 100%;

}

所以,这个侧边栏页脚代码会产生问题。

我不知道为什么这个代码会破坏表 - 响应侧边栏。

我打开simple-sidbar.css,看看这个代码

String[] strArr = numbers.split(",");
int[][] array = new int[1][];
for(int i = 0; i < strArr.length; i++) {
    array[0][i] = Integer.parseInt(strArr[i]);
}

我删除了{}中的代码,但仍有问题。

所以,我删除了母版页中的侧边栏页脚。是的。我解决了问题。

任何人都告诉我为什么这个侧边栏页脚会损坏滚动条。