I have a GridView
in a ASP.NET web application, in which I have added two buttons in each row:
protected void btnS10_click(object sender, EventArgs e)
{
foreach (GridViewRow row in Grd.Rows)
{
CheckBox chk_Single = (CheckBox)row.FindControl("ChkSendOne");
if (row.RowType == DataControlRowType.DataRow)
{
string id = (row.Cells[0].FindControl("lblSNo") as Label).Text;
if (Convert.ToInt32(id) <= 10)
{
chk_Single.Checked = true;
if (chk_Single.Checked == true)
{
lblSelectedRecord.InnerText = (Convert.ToInt32(lblSelectedRecord.InnerText) + 1).ToString();
}
}
}
}
}