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

Individual Panel Resizing

3 Answers 63 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Corey
Top achievements
Rank 1
Corey asked on 23 Feb 2011, 05:40 PM
I posted this originally in another thread but didn't get a response so I thought making a new thread might make sense.

I have a carousel and we have a template setting the contents of the panels.  We have data bound to chart controls that are inside of a carousel, which works great if all of the charts are the same type/size.  Our problem is that we have 6 charts and they don't all have the same amount of data/bars so when the carousel draws, some of the panels are way too wide for the charts inside them.  We would like a way to re-size individual panels to accommodate the different chart sizes.  How can we re-size individual panels if they are being drawn from a data collection?  Is there a way to just set the size of each object in the collection before it gets drawn into the carousel?

Thank you for any help you can provide.

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 23 Feb 2011, 08:51 PM
Hello Corey,

Generally, the default style for the CarouselItem sets the MaxHeight and MaxWidth properties and that causes a restriction for the size of an item. You may try to set the following style targeting the CarouselItem:

<Window.Resources>
        <Style TargetType="telerik:CarouselItem">
            <Setter Property="MaxHeight" Value="1000" />
            <Setter Property="MaxWidth" Value="1000" />
            <Setter Property="Height" Value="Auto"/>
            <Setter Property="Width" Value="Auto"/>        
        </Style>           
</Window.Resources>

In case this does not correspond to your requirements, please provide a bit more information about the settings of the RadCarousel and its items. Basically, any relevant code-snippet would be helpful.

 

Greetings,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Corey
Top achievements
Rank 1
answered on 23 Feb 2011, 08:58 PM
For a little more clarification.

I want to have different sizes for each of the panels.  For instance I have 5 panels with 5 different chanrts in them.  They all derive their size and content from a dataTemplate that is bound to data so they all look the same currently based on what is in the dataTemplate.  I want to have the width of item 1 = 300px and the width of item 2 = 150px and the width of items 3, 4 and 5 = 450px.  As it stands right now, they all take the same width and height settings so the chart with 5 columns is the same width of the chart with 2 columns which is a problem.

Corey
0
Maya
Telerik team
answered on 25 Feb 2011, 02:56 PM
Hi Corey,

May you take a look at the sample project attached and let me know whether the demonstrated approach meets your requirements ? 


Regards,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Carousel
Asked by
Corey
Top achievements
Rank 1
Answers by
Maya
Telerik team
Corey
Top achievements
Rank 1
Share this question
or