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
C#
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
Komal Patel20 pointsPosted Jan 7, 2009, 6:34 PM EST
if you got your if condition returns true and you are getting error in assigning blank string then you can try String.Empty to assign blank string
hope this would help you