Checkbox related code in DataGrid

xiaoxiao2021-03-05  28

Private void Button1_Click (Object Sender, System.Eventargs E)

{

Checkbox C1; // = new checkbox ();

For (INT i = 0; i

{

C1 = (Checkbox) DG1.Items [i] .findControl ("CheckBox1");

IF (c1! = null && c1.checked)

{

Label1.text = label1.text DG1.Items [i] .cells [1] .text;

Label2.text = label2.text DG1.Items [i] .Cells [2] .TEXT;

}

}

Note that C1! = NULL This judgment, if this judgment is not added, NULL is abnormal error occurs.

转载请注明原文地址:https://www.9cbs.com/read-34036.html

New Post(0)