Hi, I;m having a problem in cells having null values. They return an error “Input String Not in Correct Format”.
What I want to do is: if the cell has no value (“”) , I will set its value to “none”
My code is:
foreach (Xceed.Grid.DataRow parentRow in g.GetSortedDataRows(true))
{
if(parentRow.Cells[“Page”].Equals(null))
{
parentRow.Cells[“Page”].Value=-1;
}
}
I also tried:
1. parentRow.Cells[“Page”].Value==null
2. parentRow.Cells[“Page”].Value.ToString().Equals(“”)
-They all still return an error…… How can I sole this problem?
Imported from legacy forums. Posted by peyton (had 1967 views)