如何卡住 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/