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

How to Find/Reference Controls in the Expander.Content?

3 Answers 103 Views
Expander
This is a migrated thread and some comments may be shown as answers.
Fred
Top achievements
Rank 1
Fred asked on 17 Nov 2009, 10:09 PM
Simlar to this post of trying to add controls into the RadExpander..

I want to be able to alter controls that are already in the expander. How can I do that? 

Simular to a findcontrol("textblock") and alter the text.  Not sure what to do with the RadExpander.Content object to find the controls.

3 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Stanoev
Telerik team
answered on 19 Nov 2009, 03:29 PM
Hello Fred,

There are several approaches you can take. First of all, you can set the Name property of each control you add and then using FindName of the parent(StackPanel in the previous thread) to find the control you are looking for. I am attaching a sample project demonstrating this functionality. Have a look at it and let me know how it works for you.

Greetings,
Kiril Stanoev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Fred
Top achievements
Rank 1
answered on 19 Nov 2009, 04:22 PM
Your example works great, and it works good on my page if I drop in a textblock for that page. i guess the problem is that I have a MainPage and it's loading up Views in a navigationframe.  The extender is on the Mainpage so it overlays all the view page, I don't get any errors when I change the code and when I step through it pulls the right control, just the page never updates.

So in answer to my originaly question yes your code works great thank you, I guess I'll have to figure out what's going on in regards to control not updating visually when it's on the parent page.
0
Fred
Top achievements
Rank 1
answered on 19 Nov 2009, 08:35 PM
Figured out what I was trying to do..

CType(CType(CTSilverLightImport.App.Current.RootVisual, MainPage).FindName("lblStep1"), TextBlock).Text = "Updated Text"


Tags
Expander
Asked by
Fred
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Fred
Top achievements
Rank 1
Share this question
or