I m trying while there is IsActive column is present in Gridview then Checkbox which is placed inside Gridview is checked..all code is running fine only last row checkbox is not checked..pls tell me solution
What I have tried:
<pre>if (e.Row.RowType == DataControlRowType.DataRow)
{
foreach (GridViewRow row in gdvUserDetails.Rows)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
string cellText = dt.Rows[i][2].ToString();
CheckBox chk = (CheckBox)row.Cells[0].FindControl("chkRow");
if (cellText == "1")
{
chk.Checked = true;
}
else
{
chk.Checked = false;
}
}
}
}