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

Adding controls to expander in run time

2 Answers 70 Views
Expander
This is a migrated thread and some comments may be shown as answers.
Nathan
Top achievements
Rank 1
Nathan asked on 22 May 2009, 07:15 PM
Is there an example of how to do this in C# at run time, or can one be provided?

Thanks!


ex. of what I'm doing atm

foreach (MyClass eResult in e.Result) 
                { 
                    RadExpander re = new RadExpander(); 
                    re.Header = new TextBlock { Text = eResult.Title, Foreground = new SolidColorBrush(Colors.White) }; 
 
                    foreach (MyOtherClass in eResult.GroupItems) 
                    { 
                        MyControl mc = new MyControl (); 
                        mc.item_name.Text = GroupItems.Name;                         
                        mc.Id = GroupItems.Id; 
                        re.Content += mc + "\n";                                                 
                    } 
                    LayoutRoot.Children.Add(re); 
                } 

2 Answers, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 25 May 2009, 12:20 PM
Hello Nathan,

Please find attached a sample project that demonstrates how to add controls to RadExpander at run time. Let me know if you have any other questions.

Greetings,
Boryana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Nathan
Top achievements
Rank 1
answered on 28 May 2009, 02:31 PM
Ah, thanks.  I didn't notice in the demo you guys used the wrap panel to make the cool orientation effects.
Tags
Expander
Asked by
Nathan
Top achievements
Rank 1
Answers by
Bobi
Telerik team
Nathan
Top achievements
Rank 1
Share this question
or