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.
}
}
}
Помогите мне, как получить элементы строки каждой проверенной строки.
Я пытался так, но ничего не добавлялось к метке
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;
}
}