tags:

views:

1629

answers:

2
+4  Q: 

WPF find a control

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?

+6  A: 

When you create an element in code, you need to also call the RegisterName method to allow FindName to work.

Ian Oakes
you are correct..That's exactly what I just found out too. Thanks.
Scott
A: 

How do i find control in grid.

Amit Ranjan