c# datagridview checkbox check if other column value is 0 -
i have datagridview checkbox column(header: status) , textbox column(header: quantity). want check automatically checkbox column if quantity 0.
loop through rows if datagridview this:
foreach (datagridviewrow row in datagridview1.rows) { //check column 3 quantity if (row.cells[3].value.tostring() == "0") { //get checkbox in column 1 , cast checkbox datagridviewcheckboxcell cell = row.cells[1] datagridviewcheckboxcell; cell.value = cell.truevalue; } }
Comments
Post a Comment