asp.net - 卡住标题,滚动 GridView

标签 asp.net gridview

如何卡住 Asp.net gridview header ? 我试图以不同的方式做到这一点,但无法做到。

我正在使用 ASP 2.0 和 VS 2010。

谁能帮我?

最佳答案

我使用 jquery floatThead

http://mkoryak.github.io/floatThead/#intro

我不得不使用一些jquery 将第一行转换为thead 才能工作。

下面的例子:

$(document).ready(function () {
    var $theadCols = $("#ContentPlaceHolder1_grdCashflow  tr:first-child"),
        $table = $("#ContentPlaceHolder1_grdCashflow");

    // create thead and append <th> columns
    $table.prepend("<thead/>");
    $table.find("thead").append($theadCols);

    // init stickyHeader
    $table.floatThead();

    //$table = $("#ContentPlaceHolder1_grdCashflow");
    $table.dataTable(
    {
        "paging": false,
        "ordering": false,
        "dom":'<"top"fi>rt<"bottom"><"clear">'
    }
    );
});

关于asp.net - 卡住标题,滚动 GridView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9648727/

相关文章:

jquery Ajax 没有响应?

javascript - 复选框值始终为 false ASP MVC 5

asp.net - 如何在azure网站中访问elmah Url?

asp.net - 如何在asp.net mvc中使用请求体

c# - 如何在应用程序运行时更改 GridView.ItemTemplate?

c# - ASP.NET GridView 将两个字段绑定(bind)到一列

asp.net - 获取 Controller asp.net-core 中的当前文化

c# - 如何根据行对象是否是 viewModel 上可用的另一个集合的一部分来更改 GridView 行背景

c# - 使用标记的 GridView 行号(仅限)

r - 如何使用 gridGraphics 转换分类 TreeMap