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

Panels on Rotator

3 Answers 106 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Spencer
Top achievements
Rank 1
Spencer asked on 28 May 2008, 10:35 AM
Hello,

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

Sort by
0
Martin Vasilev
Telerik team
answered on 30 May 2008, 12:55 PM
Hello Spencer,

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
0
Richard Thurgood
Top achievements
Rank 1
answered on 11 Jul 2008, 07:20 PM
I posted this in the general discussion but thought it was more appropriate here.

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?!!!!!  :-)

0
Martin Vasilev
Telerik team
answered on 14 Jul 2008, 03:53 PM
Hi Richard,

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
Tags
Rotator
Asked by
Spencer
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Richard Thurgood
Top achievements
Rank 1
Share this question
or