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

4 posts, 1 answers
  1. Fred
    Fred avatar
    86 posts
    Member since:
    Sep 2008

    Posted 17 Nov 2009 Link to this post

    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.
  2. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 19 Nov 2009 Link to this post

    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.
  3. DevCraft banner
  4. Fred
    Fred avatar
    86 posts
    Member since:
    Sep 2008

    Posted 19 Nov 2009 Link to this post

    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.
  5. Fred
    Fred avatar
    86 posts
    Member since:
    Sep 2008

    Posted 19 Nov 2009 Link to this post

    Figured out what I was trying to do..

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


Back to Top