I have a Gridview
in which I want to hide a column based on some condition. So for that I have written a js code which is below
function GridExpInfo_ClientInsert() {
var rowVal = GridExpInfo.Rows.length - 1;
for (i = 0; i < GridExpInfo.Rows.length; i++) {
if (GridExpInfo.Rows[i].Cells[7].Value == "" || GridExpInfo.Rows[i].Cells[7].Value == "0") {
document.getElementById('GridExpInfo_ob_GridExpInfoBodyContainer_ctl33_'+rowVal+'_ctl00_'+rowVal+'_Button1_'+rowVal+'').style.display = "none";
} else {
}
}
}
It works fine, till there is one row added. But if I go to add second row what happens is the first row again gets show
and the second(current) rows gets hide
.
So how to hide all the rows whose values consist of 0