Hey guys,
Someone had asked about showing a form in a Carousel or Rotator - don't remember which. Anyway, that got me thinking...hmmmm....though you may not be able to show an entire form in those controls, you can display a RadPanel in those controls. So then it occurred to me that you could create a RadPanel on a different form, then populate the Carousel or Rotator with that panel. This allows you to put the entire contents of the RadPanel from Form2 on Form1.
Here's what I mean....
Consider this:
- Create two forms - Form1 and Form2
- On Form1, add a RadRotator and a button to change rotator pages (button click, radRotator1.Next();)
- On Form2, add two RadPanels and some RadButtons or other rad controls on each panel
- Back on Form1, create these two methods:
private RadPanel GetPanel(Form form, string panelName)
{
RadPanel panel = (RadPanel)form.Controls[panelName];
if (panel == null)
{
panel = new RadPanel();
panel.Text = "UNKNOWN PANEL: " + panelName;
}
return panel;
}
private void PopulateRotator()
{
//create instance of Form2
Form2 form2 = new Form2();
//get radPanel1 from Form2
Telerik.WinControls.UI.RadPanel panel = this.GetPanel(form2, "radPanel1");
radRotator1.RotatorElement.Items.Add(new RadHostItem(panel));
//get radPanel2 from Form2
panel = this.GetPanel(form2, "radPanel2");
//add the second panel to the rotator
radRotator1.RotatorElement.Items.Add(new RadHostItem(panel));
radRotator1.OpacityAnimation = true;
radRotator1.Next();
}
- Finally, add the Form_Load event in Form1 and call the PopulateRotator() method.
DISCLAIMER: Just an idea. You'll need to add error handling and stuff...and eh...did I mention this was only an idea?!!!!! :-)