Databinding subproperty object null
I have DataGrid with explicitly created columns in code. I am binding WPF element in code like thi开发者_开发问答s:
var path = "ReferenceProperty." + otherObj.StringProperty;
var dataBinding = new Binding(path) { TargetNullValue = "not set" };
The problem occurs when i create new row in the DataGrid, the ReferenceProperty is null and exception is thrown. If i try to create ReferencePropertys object in the default ctor NHibernate argues that transient object wasn't saved before flush. How can i solve it?
Thanks in advance.
Sounds like you need to specify a cascade for this many-to-one reference. Either set it to all or save-update.
精彩评论