i traverse values found in datagridview, check if value null , if null place "0" value not null. can please assist?
for (int = 0; < (datagridview1.rows.count - 1); i++) { (int j = 0; j < (datagridview1.columns.count - 1); j++) { if (datagridview1.rows[i].cells[j].value == null) { datagridview1.rows[i].cells[j].value.equals("0"); } } } thanks!
use:
if (datagridview1.rows[i].cells[j].value == system.dbnull.value) { datagridview1.rows[i].cells[j].value="0"; } as condition checking null values in datagridview. if need may check string.isnullorwhitespace well.
Comments
Post a Comment