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

Dynamic RadExpander

3 Answers 25 Views
Expander
This is a migrated thread and some comments may be shown as answers.
Aditya
Top achievements
Rank 1
Aditya asked on 23 Jun 2011, 09:12 AM
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.

3 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 28 Jun 2011, 05:02 PM
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
0
Steve
Top achievements
Rank 1
answered on 22 Aug 2014, 04:47 PM
your demo does not work all three data templates appear in the expander
0
Pavel R. Pavlov
Telerik team
answered on 27 Aug 2014, 12:56 PM
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.

Regards,
Pavel R. Pavlov
Telerik
 
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.
 
Tags
Expander
Asked by
Aditya
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Steve
Top achievements
Rank 1
Pavel R. Pavlov
Telerik team
Share this question
or