Dynamic RadExpander

4 posts, 0 answers
  1. Aditya
    Aditya avatar
    16 posts
    Member since:
    Jun 2011

    Posted 23 Jun 2011 Link to this post

    I want Rad Expander which dynamically contains textbox,dropdownbox,multiline textbox .

    For this purpose i have table that comming form database which contains information as ID,ControlName
    for eg    1   Textbox
                  2  MultiTextBox
                  3 Dropdown.
  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 28 Jun 2011 Link to this post

    Hi Aditya,

    I am not sure if I understand your scenario correctly. Do you need to add a list of different controls in the RadExpander's Content based on all records in a table or you need to base the Content of the RadExpander on a single record from the table?

    In both scenarios you will need to add some custom logic to create the controls based on the business data. For example if you need to fill the RadExpander.Content with different controls based on all the data in a table, you can take advantage of Telerik's ItemsControl. You can use it as the RadExpander.Content and use its ItemTemplateSelector property to choose a template for its items based on the business data. I attached a sample project illustrating this approach.

    Have a look at it and let us know if this is what you had in mind.

    Best wishes,
    Tina Stancheva
    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
  3. Steve
    Steve avatar
    1 posts
    Member since:
    Jul 2014

    Posted 22 Aug 2014 in reply to Tina Stancheva Link to this post

    your demo does not work all three data templates appear in the expander
  4. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1246 posts

    Posted 27 Aug 2014 Link to this post

    Hello Steve

    If you take a closer look at the ItemsSource of the RadExpander you will see that it contains all three controls. This is why the RadExpander visualizes all three templates at the same time.

    Pavel R. Pavlov
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top