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

Show Form in RadRotator

3 Answers 45 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Richard Thurgood
Top achievements
Rank 1
Richard Thurgood asked on 10 Jul 2008, 11:27 PM

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

3 Answers, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 11 Jul 2008, 07:34 AM
Hi Richard,

Yes that would be possible, indeed. My only concern here is about how smooth the animations would be when using controls in RadCarousel or RadRotator. Since the controls have different paint cycles, the graphics may appear a bit distorted. This should not be a great problem if you use solid background (i.e. without gradient).
Otherwise - nice idea, thank you about that and keep up posting!

Best wishes,
Mike
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, 03:46 PM
Yes, the transition with panels that have graphic backgrounds are a bit jerky. Is there any way I can "fade" it in instead of rotate it into view? I think this would solve the problem and still look cool.
0
Mike
Telerik team
answered on 14 Jul 2008, 08:32 PM
Hello Richard,

Unfortunately, RadRotator does not have the capability to apply opacity to any hosted Control with revolving items, but only to items that consist of TPF UI elements. If you think this scenario is worth the try, you can take a look at how I solved a similar problem with RadCarousel:
http://www.telerik.com/community/forums/thread/b311D-bembht.aspx

 
Kind regards,
Mike
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Richard Thurgood
Top achievements
Rank 1
Answers by
Mike
Telerik team
Richard Thurgood
Top achievements
Rank 1
Share this question
or