views:

36

answers:

0

I have a datagridview and want to put 0 in a textboxcolumn. I punch in 0 but then some other routines fail because of an typeconversion exception. The column type of the underlying datasource is float. Yet

this.CurrentCell.Value = {}

this.CurrentCell.FormattedValue="0%";

this.CurrentCell.Value.ToString() = "0";

For any other numeric value all read as I would expect. i.e. for 10 they read:

this.CurrentCell.Value = 10;
this.CurrentCell.FormattedValue="10%";
this.CurrentCell.Value.ToString() = "10";

Can anyone explain why 0 is respresented by this odd {} value?