Click here to Skip to main content
16,008,490 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
C#
function ComparePopup(gridName, value) {
        var myGrid = document.getElementById("<%= gridviewSearchResult.ClientID %>");
        var oRows = myGrid.rows;
        var rawDataRows = new Array();
        var hdncounter = document.getElementById("<%= hdnCounter.ClientID %>");
        var hdncount = document.getElementById("<%= hidCounter.ClientID %>");
        var cell;
        var j;
        for (var i = 0; i < oRows.length; i++) {
            var oRow = oRows[i];
           // for (var j = 0; j < oRows.cells.length; j++) {
            alert(myGrid.rows(i).cells(0).textContent);
//            if (oRow.getCell(0).getValue() == "true") {
//                j = j + 1;
//            }
       // }
     }

        if (hdncounter != "") {
            var counter = parseInt(hdncounter.value);
            hdncount.value = j + counter;

        }
        else {
            hdncount.value = j;
        }
        if (hdncount.value > 3) {
            var res = confirm("Since you have selected more than 3 profiles, their profiles will be exported to excel for comparison.");
            if (res != true)
                return false;
            else
                return true;
        }
    }
Posted

1 solution

C#
function ComparePopup(gridName, value) {
    var myGrid = document.getElementById("<%= gridviewSearchResult.ClientID %>");
    var oRows = myGrid.rows;
    var rawDataRows = new Array();
    var inps = myGrid.getElementsByTagName("input");
    var hdncounter = document.getElementById("<%= hdnCounter.ClientID %>");
    var hdncount = document.getElementById("<%= hidCounter.ClientID %>");
    var cell;
    var j=0;
    for (var i = 0; i < oRows.length; i++) {
        var oRow = oRows[i];
        if (myGrid.rows(i).cells(0).children[0] != null && myGrid.rows(i).cells(0).children[0].checked == true) {
            j = j + 1;
        }
    }
    if (hdncounter != "") {
        var counter = parseInt(hdncounter.value);
        hdncount.value = j + counter;

    }
    else {
        hdncount.value = j;
    }
    if (hdncount.value > 3) {
        var res = confirm("Since you have selected more than 3 profiles, their profiles will be exported to excel for comparison.");
        if (res != true)
            return false;
        else
            return true;
    }
}
 
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