George Laing

George Laing

  • NA
  • 35
  • 0

Suppressing zeroes or forcing a space in a data Grid

Jan 7 2009 1:46 PM

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)