Hello,
I just have downloaded new SR and looks like problem which we've been talking about here has not resolved. Grid still cannot insert reference type values, I get empty cell after that, and I even cannot edit this added cell.
I don't know, maybe that was about my curly hands, but I updated all references in project and completely rebuilded it, and it still doesn't work.
I've attached sample code below.
Thank you
So the reason this is happening is because you're trying to set the "Value" property of the "Field" object, and this "Field" object is null. You can take a look at this post for more information about that. Basically, this is what I changed in your project to make it work:
In the definition of the Person class:
public KeyValue Field
{
get
if (_field == null)
_field = new KeyValue(string.Empty);
}
return _field;
set{
if (_field.Value == "")
throw new ArgumentException("ERROR!!!");
_field = value;
NotifyPropertyChanged("Field");
Thank you. Forgot about initialization.