This is a migrated thread and some comments may be shown as answers.

How do I get the childern of a ContentPresenter?

1 Answer 102 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sreedevi
Top achievements
Rank 1
Sreedevi asked on 10 Dec 2011, 11:53 AM
Hi Team,

Using the code I can get a content presenter. I would like to change the text(textbox/checkbox)of all controls accordingly.Here all these controls are adding dynamically so i am not able to locate into DOM Explorer.

Please find attached document for hieraxhy in DOM your reference.

Appreciate your help, It’s really a show stopper for us to go ahead, Please help us to overcome this issue.

Thanks in advance


-Sreeee

1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 11 Dec 2011, 07:09 PM
Hi Sreedevi,

If I understand the problem correctly, the best way is going to be using some code similar to this:

IList<TextBox> textBoxes = Pages.HomeSilverlightSDK.SilverlightApp.SampleContentPresenter.Find.AllByType<TextBox>();
textBoxes[0].User.TypeText("Text ABC", 50);
textBoxes[1].User.TypeText("Text DEF", 50);
textBoxes[2].User.TypeText("Text GHI", 50);
textBoxes[3].User.TypeText("Text JKL", 50);


All the best,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Sreedevi
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or