FINDING CHILD CONTROL IN WPF

Rajesh Goswami

Total Post:29

Points:203
Posted by  Rajesh Goswami
WPF 
WPF
 2815  View(s)
Ratings:
Rate this:

Hi,

I am working on a WPF application where I have a requirement to get all chils of specific type, but I am unable to get all child controls of specific type in WPF.

Please help.

Thanks.

  1. Alex R

    Post:40

    Points:280
    Re: Finding child control in WPF

    Hi Rajesh,

    To get list of all childs in WPF you need to use VisualTreeHelper class.
    You can use VisualTreeHelper.GetChild(object parent, int childIndex)

    Check my following Blog where I have written code to get list of all child of specific type.

    http://www.mindstick.com/Blog/155/How%20to%20find%20Child%20of%20control%20in%20WPF

    Hope, the above link will help you.

    Thanks.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!