Hi,
In the code-behind of a WPF application I have a variable containing a GridView. I know for sure that this GridView is the View of a ListView. Is there any way to get a reference to that ListView?
Thanks
Hi,
In the code-behind of a WPF application I have a variable containing a GridView. I know for sure that this GridView is the View of a ListView. Is there any way to get a reference to that ListView?
Thanks
http://www.hardcodet.net/2008/02/find-wpf-parent
We've been using these helper classes for a while to find visual elements in the visual tree. In this case, you'd just want to use the method and it will hunt down the visual ancestor.
TryFindParent<ListView>(yourGridView);