c# datagrid 在后台判断所有选择了的行获取选中行的某列

2025-03-12 14:47:28
推荐回答(3个)
回答1:

循环判断复选框就可以了,利用selectitems

回答2:

for (int i = 0; i < this.datagridId.Rows.Count; i++)
{
HtmlInputCheckBox chb = gvList.Rows[i].Cells[0].FindControl("复选框ID") as HtmlInputCheckBox;
if (chb != null)
{
if (chb.Checked)
{
//你的代码
}
}
}

回答3:

dataGrid?? WPF的么