This is a migrated thread and some comments may be shown as answers.
Panel size - ReusableRadCarouselPanel example
9 Answers 114 Views
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 17 Dec 2008, 01:31 PM
Hi..
How do I enlarge the panel size?
Say for instance - want to increase the carousel items to  500 x 500 for all items in the data template?
thanks again!

9 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 18 Dec 2008, 08:55 AM
Hello Jon,

You can achieve the desired behavior by setting a global style to the CarouselItem.

For example:
 <Grid.Resources> 
            <Style TargetType="{x:Type telerik:CarouselItem}">  
                <Setter Property="MaxHeight" Value="500"/>  
                <Setter Property="Height" Value="500"/>  
                <Setter Property="Width" Value="500"/>  
            </Style> 
</Grid.Resources> 

You might also find our Global Styles help article useful.

Hope this helps.

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jon
Top achievements
Rank 1
answered on 18 Dec 2008, 03:52 PM
I'm using a template - just like your example... where do I place the code?  thanks again


 

 

<Setter Property="Template" >

 

 

 

<Setter.Value>

 

 

 

<ControlTemplate TargetType="{x:Type telerik:CarouselItem}">

 

 

 

<Grid ClipToBounds="False" Height="200" Width="250" >

 

 

 

<Border RenderTransformOrigin="0.5, 1" ClipToBounds="False" Width="{Binding ElementName=CarouselItemInnerGrid, Path=ActualWidth}"

 

 

Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ReflectionSettings.Opacity}"

 

 

Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ReflectionSettings.Visibility}"

 

 

BorderBrush="White"

 

 

BorderThickness="5">

 

 

 

<Border.RenderTransform>

 

 

 

<TransformGroup>

 

 

 

<ScaleTransform

 

 

0
Rosi
Telerik team
answered on 19 Dec 2008, 08:39 AM
Hi Jon,

Please find the attached sample project illustrating how to achieve the desired behavior.
If you have any questions do not hesitate to ask.

Hope this helps.

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
UIdev
Top achievements
Rank 1
answered on 12 Jun 2009, 06:47 PM
Hi,

I'm using the following code for styling my CarouselItems:

    <Grid ShowGridLines="True" x:Name="thegrid"
        <Grid.Resources> 
            <Style TargetType="{x:Type telerik:CarouselItem}" x:Key="cistyle"
                <Setter Property="Height" Value="240" /> 
                <Setter Property="Width" Value="320" /> 
            </Style> 
        </Grid.Resources> 
... 

This works fine for initially sizing my CarouselItems.  However, I want to have the ability to change the sizes at runtime.  I've tried the following code, which does not work:

            Style s = new Style(); 
            s.TargetType = typeof (CarouselItem); 
            s.Setters.Add(new Setter(CarouselItem.HeightProperty, 100)); 
            s.Setters.Add(new Setter(CarouselItem.WidthProperty, 100)); 
            thegrid.Resources["cistyle"] = s; 

This seemed to be the same kind of thing the XAML <Style> was doing.  However, my C# code does not achieve what it looks like it would (this code apparently does nothing).  Can you guys provide an example of changing the size of CarouselItems at runtime?  I would really appreciate it!

Thanks so much,

UIdev
0
Milan
Telerik team
answered on 15 Jun 2009, 09:18 AM
Hi UIdev,

I have created a sample application that demonstrates how you can change the item size dynamically.

Regards,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
UIdev
Top achievements
Rank 1
answered on 16 Jun 2009, 02:36 AM
Hi Milan,

Your solution worked perfectly.  Thanks so much for the great help!

-UIdev
0
xola139
Top achievements
Rank 1
answered on 15 Mar 2010, 06:17 AM
This I was looking excellent, thanks for the tip
0
Corey
Top achievements
Rank 1
answered on 21 Feb 2011, 09:31 PM
Not trying to hijack the OP's thread here but I have a similar question to that of the OP.

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.
0
Maya
Telerik team
answered on 23 Feb 2011, 08:52 PM
Hi Corey,

Please take a look at the related forum thread for a reference. 

Kind 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!
Asked by
Jon
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Jon
Top achievements
Rank 1
UIdev
Top achievements
Rank 1
Milan
Telerik team
xola139
Top achievements
Rank 1
Corey
Top achievements
Rank 1
Maya
Telerik team
Share this question
or