Home Forums WinForms controls Xceed Grid for WinForms NullException or Input String Not In Correct Format Error

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #14179 |

    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)

    User (Old forums)
    Member
    Post count: 23064

    You don’t have to do it like that. The Cell and Column class have a property NullText. Whenever a Cell value is null, it will display as this NullText.<pre>grid.Columns[“Page”].NullText = “none”;</pre>

    Imported from legacy forums. Posted by Tommy (had 2982 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.