How to access data from another datatemplate in wpf?

徘徊边缘 提交于 2019-12-02 08:25:38

You could try to use a Binding with the RelativeSource property set to the FindAncestor mode and looking for a DataGrid object. However, I am not sure whether it will work in your scenario because I do not know how these DataTemplates are related to each other. Is the second DataTemplate used for the items in the DataGrid?!

Somehow, your design feels strange to me. Are you sure that you need DataTemplates in both cases? What exactly do you want to achieve?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!