gridview选择中的性能问题 [英] Performance issue in gridview selction
问题描述
我的网站上有一个GridView,它可以很好地绑定超过1000条记录。但是当我选择GridView行时,我面临性能问题。
对于这些,我尝试了不同的方法来提高性能。但我仍然面临着这个问题。
任何人都有任何建议或帮助吗?
我尝试过:
< script type = text / javascript>
/ * 第一种方法* /
$( function (){
$( [id * = GVTaskList] )。find( [id * = lnkSelect])。click( function (){
// 引用GridView行。
var row = $( this )。nearest( tr);
var 条消息= 行索引: +(行[ 0 ].rowIndex - 1 );
$(' #hdnGVTaskList')。val(行[ 0 ]。rowIndex - 1 );
document .getElementById( BtnGVTaskList< /跨度>)点击();
return false ;
});
});
/ * 第二种方法* /
function RadioCheck(rb){
var gv = document .getElementById( <%= GVTaskList.ClientID%>) ;
var rbs = gv.getElementsByTagName( 输入跨度>);
var row = rb.parentNode.parentNode;
for ( var i = 0 ; i< rbs.length; i ++){
if (rbs [i] .type == < span class =code-string> radio){
if (rbs [i] .checked&& rbs [i]!= rb){
rbs [i] .checked = false ;
break ;
}
}
}
// document.getElementById( BtnGVTaskList)。click();
}
/ * 第三种方法是GVTaskList_SelectedIndexChanged * /
< / script>
( function (){
( [id * = GVTaskList])。find( [id * = lnkSelect])。click( function (){
// 引用GridView行。
var row =
I have a GridView in my website and it's working fine with binding more than 1000 records. But I am facing performance issue when I selecting the GridView row. 这篇关于gridview选择中的性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
var message = 行索引: +(row [ 0 ]。rowIndex - 1 );
For these I have tried different ways to increase the performance. But still I am facing the issue.
Any one have any suggestions or help?
What I have tried:
<script type="text/javascript">
/* 1st Method */
$(function () {
$("[id*=GVTaskList]").find("[id*=lnkSelect]").click(function () {
//Reference the GridView Row.
var row = $(this).closest("tr");
var message = "Row Index: " + (row[0].rowIndex - 1);
$('#hdnGVTaskList').val(row[0].rowIndex - 1);
document.getElementById("BtnGVTaskList").click();
return false;
});
});
/* 2nd Method */
function RadioCheck(rb) {
var gv = document.getElementById("<%=GVTaskList.ClientID%>");
var rbs = gv.getElementsByTagName("input");
var row = rb.parentNode.parentNode;
for (var i = 0; i < rbs.length; i++) {
if (rbs[i].type == "radio") {
if (rbs[i].checked && rbs[i] != rb) {
rbs[i].checked = false;
break;
}
}
}
//document.getElementById("BtnGVTaskList").click();
}
/* 3rd Method is GVTaskList_SelectedIndexChanged */
</script>
(function () {
("[id*=GVTaskList]").find("[id*=lnkSelect]").click(function () {
//Reference the GridView Row.
var row =
(this).closest("tr");
var message = "Row Index: " + (row[0].rowIndex - 1);