Get parent list from gridview object

In the code for the WPF application, I have a variable containing a GridView. I know for sure that this GridView is a ListView. Is there a way to get a link to this ListView?

thanks

+3
source share
1 answer

http://www.hardcodet.net/2008/02/find-wpf-parent

We used these helper classes for a while to find visual elements in the visual tree. In this case, you just want to use this method, and it will track down the visual ancestor.

TryFindParent<ListView>(yourGridView);
-1
source

Source: https://habr.com/ru/post/1717628/


All Articles