protected void Button1_Click(object sender, EventArgs e)
{
foreach (DataGridItem di in GridView1.Items)
{
HtmlInputCheckBox chkBx = (HtmlInputCheckBox)di.FindControl("CheckBox1");
if (chkBx != null && chkBx.Checked)
{
//What should I write to get the Items of that checked row.
}
}
}
Help me how to retrieve the row items of the each checked row.
I tried like this but its not appending anything to the label
foreach (GridViewRow di in GridView1.Rows)
{
HtmlInputCheckBox chkBx = (HtmlInputCheckBox)di.FindControl("CheckBox1");
if ( chkBx != null && chkBx.Checked)
{
FID[j] += di.Cells[2].Text;
j++;
Label1.Text += di.Cells[2].Text;
}
}
It should
RowsinsteadItems