I created a grid in procedural code on my WPF page. Now I want to reference that grid.
Grid grid = (Grid)This.FindName("myGridName")
does not work. Ideas?
I created a grid in procedural code on my WPF page. Now I want to reference that grid.
Grid grid = (Grid)This.FindName("myGridName")
does not work. Ideas?
When you create an element in code, you need to also call the RegisterName method to allow FindName to work.