Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Carousel > host UserControl in Carousel

Not answered host UserControl in Carousel

Feed from this thread
  • Eli avatar

    Posted on May 26, 2008 (permalink)

    Hi.
    I'm trying to create a TabControl with a movment-change affect between tabs.
    To do this, I need to do 2 things:

    1. Can I put UserControl as the Carousel element?
    2. Can I control the movment path of the carousel? (I just want a horizontal movment, and not circular)

    Thanks.

    Reply

  • Peter Peter admin's avatar

    Posted on May 26, 2008 (permalink)

    Hello Eli,

    Thank you for your interest in RadCarousel. We hope you find it a useful addition to our product.

    1) You should add any control in the carousel item using the following code:

                DateTimePicker ctl = new DateTimePicker();
                ctl.AutoSize = false;//switch off MS autolayout functionality
                ctl.MinimumSize = new Size(110,20);
                RadHostItem hostItem = new RadHostItem( ctl );
                this.radCarousel1.Items.Add(hostItem);

    2) For horizontal moving, you should use the Carousel Bezier path with the same Y coordinates.
    For example:

                carouselBezierPath1.AllowRelativePath = false;
                carouselBezierPath1.CtrlPoint1 = new Telerik.WinControls.UI.Point3D(377, 140, 0);
                carouselBezierPath1.CtrlPoint2 = new Telerik.WinControls.UI.Point3D(93, 140, 0);
                carouselBezierPath1.FirstPoint = new Telerik.WinControls.UI.Point3D(25, 140, 0);
                carouselBezierPath1.LastPoint = new Telerik.WinControls.UI.Point3D(435, 140, 0);
                carouselBezierPath1.ZScale = 500;
                this.radCarousel1.CarouselPath = carouselBezierPath1;
                this.radCarousel1.EnableLooping = true;

    If you have additional questions, do not hesitate to contact me.

    Kind regards,
    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Eli avatar

    Posted on May 26, 2008 (permalink)

    Thanks, I'll give it a try.

    Great control!

    Reply

  • Jon Master avatar

    Posted on Jun 23, 2008 (permalink)

    Hi..
    How do you assign the Text property to the carousel item, once you add the control to the RadHostItem?
    thanks

    Reply

  • Peter Peter admin's avatar

    Posted on Jun 24, 2008 (permalink)

    Hello Jon Elster,

    Thank you for writing.

    Could clarify what you mean by "Text property to the carousel item". Usually, the Text property can be assigned with the code below:

                    RadButtonElement carouselItem = new RadButtonElement();
                    carouselItem.ImageAlignment = ContentAlignment.MiddleCenter;
                    carouselItem.TextAlignment = ContentAlignment.MiddleCenter;
                    carouselItem.DisplayStyle = DisplayStyle.Text;//or ImageAndText
                    carouselItem.TextImageRelation = TextImageRelation.ImageAboveText;
                    carouselItem.ShowBorder = false;

                    carouselItem.Text = "First Item";
                    
                    this.radCarousel1.Items.Add(carouselItem);


    Let me know if I can help you further.

    All the best,
    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

    Reply

  • Jon Master avatar

    Posted on Jun 24, 2008 (permalink)

    Yes.. that's what I needed... thanks..

    Reply

  • petr avatar

    Posted on Feb 9, 2010 (permalink)

    Hi
    I have one more question reagarding the discussion above. Features you are describing works great except one small problem Im facing - not able to set up the font properties (size, family, bold and so on).
    Here is the piece of my code:

     

    RadImageButtonElement ribe = new RadImageButtonElement();

     

    ribe.Image =

    Image.FromFile("C:\\Projects\\image.jpg");

     

    ribe.DisplayStyle =

    DisplayStyle.ImageAndText;

     

    ribe.TextImageRelation =

    TextImageRelation.TextAboveImage;

     

    ribe.ShowBorder =

    true;

     

    ribe.Text = produkt.ProductName;

    ribe.TextAlignment =

    ContentAlignment.MiddleCenter;

     

     

    //ribe.Font.Size = 15;

     

    Products_radCarousel.Items.Add(ribe);

    Commented green line didn't works for me - as this property is read only. How can I change the font (font.size for example) in this context?

    Reply

  • Nikolay Nikolay admin's avatar

    Posted on Feb 12, 2010 (permalink)

    Hi,

    In Windows Forms you can change a font setting by creating a new Font object, for example:
    RadButtonElement ribe = new RadButtonElement();
    ribe.Font = new Font(ribe.Font.FontFamily, 15, ribe.Font.Style);

    If you have additional questions, feel free to contact me.

    Sincerely yours,
    Nikolay
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Posted on Nov 18, 2010 (permalink)

    Hello,

    I am trying to achieve exactly what the topic of the thread is about : include a User Control in the Carousel.
    I have tried to put exactly the code proposed by Peter (from 2008) with no real success :

    DateTimePicker ctl = new DateTimePicker();
    ctl.AutoSize = false;//switch off MS autolayout functionality
    ctl.MinimumSize = new Size(110,20);
    RadHostItem hostItem = new RadHostItem( ctl );
    this.radCarousel1.Items.Add(hostItem);

    The problem I encounter is that if I put that in a loop (4 occurences for example), it will only add two elements and the carousel's rotation and events are not fired anymore.

    What I am trying to achieve is the following :

    for(int i = 0 ; i < maxLength ; ++i)
    {
        MyUserControl ctl = new MyUserControl(param1, param2);
        ctl.AutoSize = false;
        ctl.MinimumSize = new Size(85, 25);
          
        RadHostItem itm = new RadHostItem(ctl);
        this.myCarousel.Items.Add(itm);
    }

    Any help would be highly appreciated as being able to use UserControl in the Carousel would be perfect for the software I am currently designing. (Maybe I am missing the obvious also :) )

    • OS Information : Windows XP x64 (version 2003) SP2
    • Telerik : RadControls for WinForms 2010.3 10.1109
    • Microsoft Visual Studio 2008
    • .NET 3.5

    Reply

  • Peter Peter admin's avatar

    Posted on Nov 23, 2010 (permalink)

    Hello Jerome Prunera-Usach,

    Thank you for writing.

    I can confirm this issue. A fix for it will be available in our next release. Your Telerik points have been updated for the feedback. Do not hesitate to contact us if you have other questions.

    Sincerely yours,
    Peter
    the Telerik team
    Get started with RadControls for WinForms with numerous videos and detailed documentation.

    Reply

  • Posted on Nov 23, 2010 (permalink)

    Thank you for your answer.

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Carousel > host UserControl in Carousel
Related resources for "host UserControl in Carousel"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]