Click here to Skip to main content
15,884,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

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:

JavaScript
<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>
Posted
Updated 26-Apr-19 5:31am

1 solution

Then it NOT "working fine" with 1000+ records.

There's usually no issue getting the "first page" up; it's "scrolling" that shows what what a performance hog was created.

It never makes sense to retrieve more than 1 page at a time in a web app.

How To Implement Paging in GridView Control in ASP.NET[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900