1
Answer

Suppressing zeroes or forcing a space in a data Grid

George Laing

George Laing

15y
2.9k
1

Hi
  I have a datagrid and I would like to either replace zero's with a space or suppress them. I have tried just putting in a space but that did not work. The field used to have -Infinity in it so I forced a zero with this line

 if (Grid_Property.Rows[i].Cells["pDiff"].Value.ToString() == "-Infinity")
                {
                    Grid_Property.Rows[i].Cells["pDiff"].Value = "";
                }

I tried to add to string in the if statement but that did not work see below

if (Grid_Property.Rows[i].Cells["pDiff"].Value.ToString() == "-Infinity")
                {
                    Grid_Property.Rows[i].Cells["pDiff"].Value.ToString = "";
                }

Any help would be appreciated

Answers (1)