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

Background for Carousel

5 Answers 90 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
ewart
Top achievements
Rank 1
ewart asked on 02 Dec 2008, 11:48 PM
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 :)

Cheers
  Ewart.

5 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 05 Dec 2008, 05:17 PM
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,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Marc
Top achievements
Rank 2
answered on 23 Dec 2008, 05:42 AM
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.
0
Peter
Telerik team
answered on 23 Dec 2008, 05:00 PM
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,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Vahagn Hokhikyan
Top achievements
Rank 1
answered on 26 Mar 2009, 08:49 PM
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.
Thanks!
0
Peter
Telerik team
answered on 30 Mar 2009, 09:33 AM
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,
Peter
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Carousel
Asked by
ewart
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Marc
Top achievements
Rank 2
Peter
Telerik team
Vahagn Hokhikyan
Top achievements
Rank 1
Share this question
or