Checkbox column is not written by script

xiaoxiao2021-03-06  39

It's the script, I first made a model column, then register the script event in each checkbox through Itemcreated.

The script is as follows:

Function selectONEROW (CHKB) {

Var xState = chkb.checked;

IF (xState)

{

Chkb.parentelement.parentelement.style.backgroundColor = 'lightcoral'; // Set the selected color, // chkb.parentelement.parentelement is referenced to the node object, and then sets the background color.

Else

{

Chkb.parentelement.parentelement.style.BackgroundColor = 'White';

}

}

Get selected values, we can use Foreach's way to loop the checkbox under the row set is TRUE. When True, output, otherwise you skip.

Foreach (DataGridItem DGI in DataGrid1.Items)

{

IF ((CheckBox) DGI.cells [0] .findControl ("Chkone")). Checked == true

Customerid = DGI.cells [1] .TEXT;

}

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

New Post(0)