blah blah blah is here! blah blah » Close

up0down
link

how could i check through my datagrid and insert "-" automaticlly if the field is null?

last answered one year ago

1 answers

link

for(int i = 0; i < myDatagridView.Rows.Count; i++)
{
foreach(DataGridViewCell c in myDatagridView.Rows[i].Cells)
{
if(c.Value == null)
c.Value = "-";
}
}


Just typed this in here, so it might not compile, but it should give you an idea

Nice one foamy - thanks.

foamy
2499

any time

Feedback