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
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;
}