开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜