Guy
  • Guy
  • Newbie Topic Starter
2012-12-07T11:32:29Z
Good evening,

After I commit a single whitespace in a cells value, in the event AfterCommitEdit the cell.Value is always null. But I need a single whitespace to be valid. If I enter " a" for example, it takes the whitespace and the a literal and accepts it. How come is this happening?

Thanks.
Igor/10Tec
2012-12-07T15:33:14Z
The cell's EmptyStringAs property determines how to treat empty strings entered by the user, and is't default value forces empty strings to be stored as null. One of the reasons of doing so is to automatically correct user's errors if they wanted to clear the cell contents but left some spaces in it.

This behavior can be redefined in the BeforeCommitEdit event. For instance, like this:

private void iGrid1_BeforeCommitEdit(object sender, iGBeforeCommitEditEventArgs e)
{
  if (string.IsNullOrWhiteSpace(e.NewText))
    e.NewValue = e.NewText;
}
Guy
  • Guy
  • Newbie Topic Starter
2012-12-10T08:21:43Z
Thank you very much sir. I appreciate that.