Panel size - ReusableRadCarouselPanel example

10 posts, 0 answers
  1. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 17 Dec 2008 Link to this post

    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!
  2. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 18 Dec 2008 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 18 Dec 2008 Link to this post

    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

     

     

  5. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 19 Dec 2008 Link to this post

    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.
  6. UIdev
    UIdev avatar
    74 posts
    Member since:
    Mar 2007

    Posted 12 Jun 2009 Link to this post

    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
  7. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 15 Jun 2009 Link to this post

    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.
  8. UIdev
    UIdev avatar
    74 posts
    Member since:
    Mar 2007

    Posted 15 Jun 2009 Link to this post

    Hi Milan,

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

    -UIdev
  9. xola139
    xola139 avatar
    9 posts
    Member since:
    Jan 2010

    Posted 15 Mar 2010 Link to this post

    This I was looking excellent, thanks for the tip
  10. Corey
    Corey avatar
    6 posts
    Member since:
    Feb 2011

    Posted 21 Feb 2011 Link to this post

    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.
  11. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 23 Feb 2011 Link to this post

    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!
Back to Top
UI for WPF is Visual Studio 2017 Ready