Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I got a gridview with a checkbox column, which I'm able to determine whether a row is checked. My problem is that I can't get the cell value. I'm using javascript. I'm using JS since I have to make an ajax call once I get the cell value. Thx in advance. Here's my code:

C#
function newData(mode) {

    if (mode == 'edit') {
        var valid = false;
        var gv = document.getElementById("myGridview");

        for (var i = 0; i < gv.all.length; i++) {
            var node = gv.all[i];
            if (node != null && node.type == "checkbox" && node.checked) {
                valid = true;
                break;
            }
        }
        if (!valid) {
            alert("Invalid. Please select a checkbox to continue.");
        }

        return valid;
    }
Posted

1 solution

Have a look on similar thread:
get gridview cell data using javascript[^]

..and more here[^]
 
Share this answer
 
v2

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