我是一個非常noob,這是我的第一個職位的傢伙,所以你的幫助是需要的 試圖禁用所有的單選按鈕控件在列表視圖時,我檢查一個複選框 ,它正在工作只有一行。如何禁用列表視圖中的單選按鈕
這裏是我的代碼:
protected void chkb_DG_NO_CheckedChanged(object sender, EventArgs e)
{
foreach (ListViewItem item in ListView1.Items)
{
RadioButton RD1 = (RadioButton)ListView1.Items[0].FindControl("R1");
RadioButton RD2 = (RadioButton)ListView1.Items[0].FindControl("R2");
RadioButton RD3 = (RadioButton)ListView1.Items[0].FindControl("R3");
RadioButton RD4 = (RadioButton)ListView1.Items[0].FindControl("R4");
RadioButton LD1 = (RadioButton)ListView1.Items[0].FindControl("L1");
RadioButton LD2 = (RadioButton)ListView1.Items[0].FindControl("L2");
RadioButton LD3 = (RadioButton)ListView1.Items[0].FindControl("L3");
RadioButton LD4 = (RadioButton)ListView1.Items[0].FindControl("L4");
RD1.Enabled = false;
RD2.Enabled = false;
RD3.Enabled = false;
RD4.Enabled = false;
LD1.Enabled = false;
LD2.Enabled = false;
LD3.Enabled = false;
LD4.Enabled = false;
}
}
我應該怎麼改?
它在組! – 2012-07-19 10:03:04