c# - text in textbox if in datagrid selection change is null -
how can command return empty space, if have in database null id , other space???
you need check if row.cells[18]
null.
var cotaid = (row.cells[18] == null) ? 0 : (int)row.cells[18].value;
this "inline if statement" equal to
if(row.cells[18] == null) cotaid = 0; else cotaid = (int)row.cells[18].value;
Comments
Post a Comment