急!!!关于DataGrid自定义模板绑定控件的问题
我在DataGrid1中创建一个ID字段和一个自定义模板列,模板列中插入CheckBox单选按钮
创建Label1、Button1
怎样做到点击Button1按钮后将选中行的ID段自动加到Label1.Text的尾部呢?
以下为我自己写的,但有些部分代码不知道怎么写,还请指教
private void Button1_Click(object sender, System.EventArgs e)
{
Label1.Text = "";
foreach(DataGridItem i in this.DataGrid1.Items)
{
CheckBox inChk = (CheckBox)i.FindControl("CheckBox1");
if(inChk.Checked == true)
{
Label1.Text += 这里应该怎么表示绑定的ID段值 + ",";
}
}
}