We have a lot of controls that don't fit on one screen. Instead of using tabs I am thinking about purchasing the Rotator control. However, I have a few questions.
Is it possible to put panels with controls on the Rotator and then rotate from one panel to another ?
Is it possible to programmatically do the rotating, without using a timer, so the user has full control ?
Many thanks.
3 Answers, 1 is accepted
Thank you for the questions.
You could put a RadPanel in RadRotator by using the RadHostItem. Please review the code-block below as an example:
RadPanel panel1 = new RadPanel(); |
panel1.BackColor = Color.Red; |
RadButton button = new RadButton(); |
button.Location = new Point(20, 40); |
button.ThemeName = "Vista"; |
button.Size = new Size(100, 18); |
panel1.Controls.Add(button); |
RadHostItem hostItem1 = new RadHostItem(panel1); |
this.radRotator1.Items.Add(hostItem1); |
You could easily rotate through the RadRotator items programmatically by using the RadRotator.Next() and RadRotator.Previous() methods.
I hope this helps. If you have other questions, do not hesitate to contact me again.
All the best,
Martin Vasilev
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Though you may not be able to show an entire form in a Carousel or Rotator, 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?!!!!! :-)
Thank you for sharing your suggestions with us.
Telerik controls offer very flexible abilities for customizing and achieving different scenario due to its WPF-like architecture. Another option for the realization of such scenario is by using UserControl with RadPanel and adding it as Hosted Control in RadRotator.
If you have other questions, do not hesitate to contact me again.
Regards,
Martin Vasilev
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center