Background for Carousel

6 posts, 0 answers
  1. ewart
    ewart avatar
    221 posts
    Member since:
    Jan 2007

    Posted 02 Dec 2008 Link to this post

    Hi, what special things do I need to do to correctly put a background on the RadCarousel?    If you drag and drop a carousel onto the form I expect to just set the BackgroundImage property and go.. but it doesn't seem to work.

    No expense was spared in trying to get this to work and eventually I found by manually adding the following line to the designer code behind I got it to display:

    ((Telerik.WinControls.Primitives.FillPrimitive)(this.rcFilterOptions.GetChildAt(0).GetChildAt(0))).Visibility = Telerik.WinControls.ElementVisibility.Hidden;

    Naturally this was not the first line of code I tried.. I guess I will put that line of code in the FormLoad in case it gets overwritten if I change the design.  Please advise if thre is a better/more correct way of getting the background to display.. and if not, please consider this a bug report, or at best, documentation request.  My apologies if I missed something when reading the docs and existing forum requests.

    My carousel looks awesum now, btw :)

  2. Nikolay
    Nikolay avatar
    1805 posts

    Posted 05 Dec 2008 Link to this post

    Hi ewart,

    Thank you for this question.

    The behavior experienced is not an issue, but this is the normal behavior. The image that you set is covered by the FillPrimitive which draws a fill gradient. In order to see the image, you should hide the FillPrimitive. There are two approaches to do this:
    ((FillPrimitive)this.radCarousel1.CarouselElement.Children[0]).ShouldPaint = false;  
    // or  
    ((FillPrimitive)this.radCarousel1.CarouselElement.Children[0]).Visibility = Telerik.WinControls.ElementVisibility.Hidden; 

    This is now scheduled for documentation in one of our next versions. If you have additional questions, feel free to contact me.

    Sincerely yours,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Marc
    Marc avatar
    21 posts
    Member since:
    Dec 2008

    Posted 22 Dec 2008 Link to this post

    I am having a little difficulty with making the background Transparent for the carousel.  I can see this is possible from the examples you have but have spent too much time trying to figure this out. 

    I set the Background to Transparent but continue to get the gradient.  Any help would be appreciated.

    Using VB in VS 2008.

    Thank you, and so far your controls are great.
  4. Peter
    Peter avatar
    1160 posts

    Posted 23 Dec 2008 Link to this post

    Hi Marc,

    Thank you for writing.

    The carousel background is a FillPrimitive with four back colors. You should set transparency for all four back colors. You can do this with the following code snippet in the FormLoad event:

    CType(Me.RadCarousel1.GetChildAt(0).GetChildAt(0), Telerik.WinControls.Primitives.FillPrimitive).BackColor2 = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer)) 
            CType(Me.RadCarousel1.GetChildAt(0).GetChildAt(0), Telerik.WinControls.Primitives.FillPrimitive).BackColor3 = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer)) 
            CType(Me.RadCarousel1.GetChildAt(0).GetChildAt(0), Telerik.WinControls.Primitives.FillPrimitive).BackColor4 = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer)) 
            CType(Me.RadCarousel1.GetChildAt(0).GetChildAt(0), Telerik.WinControls.Primitives.FillPrimitive).BackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer)) 

    Please refer to attached project.

    Hope this helps.

    All the best,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Vahagn Hokhikyan
    Vahagn Hokhikyan avatar
    6 posts
    Member since:
    Feb 2005

    Posted 26 Mar 2009 Link to this post

    I would like to achieve transparency discribed in this post (transparent back color over background image). I tried setting the background color to web->transparent, and I was pleased with the appearance of the carousel, however the rendering is really really slow in that case. I have also tried the posted solutions, the same result. When I set the background color to a solid color then the rendering is very fast, but if I set it to transparent or Hide the primitive as discussed above I get really slow rendering. Could you please tell me how to acheive transparency without paying huge penalty on the rendering time.
  6. Peter
    Peter avatar
    1160 posts

    Posted 30 Mar 2009 Link to this post

    Hi Vahagn Hokhikyan,

    I would suggest you set ItemReflectionPercentage property to zero or decrease its value. Or you can avoid transparency by setting a Carousel background image that mixes well with the form background.

    A very good example that demonstrates the RadCarousel with a well-mixed background is located in the Quck Start Framework under RadCarousel -> Music Library.

    Contact me again if you have any further questions.

    All the best,
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Back to Top