开发者

Databinding subproperty object null

开发者 https://www.devze.com 2023-03-02 19:10 出处:网络
I have DataGrid with explicitly created columns in code. I am binding WPF element in code like thi开发者_开发问答s:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消