开发者

Binding two collections with a common parameter

I would like to display the content of two differents ObservableCollection in a same grid. They have a parameter in common (an id) and I wa开发者_高级运维nt to link the two collections thanks to this id. I suppose I must use a multi binding, but how can I say I want to "link" the ids?

If I'm not clear enough, just say me.

Thanks,

M.


No MultiBinding can't help in this case

If there is one to one relation you can add property of second class to first class which returns correct item and access to second object by that property in binding, like this

{Binding classA.propB.Name}

Another way to do this I see now, is to create wrapepr class, which wraps both in one, and create new observablecollection property which contains joined collections

Hope this helps

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜