Individual Panel Resizing

4 posts, 0 answers
  1. Corey
    Corey avatar
    6 posts
    Member since:
    Feb 2011

    Posted 23 Feb 2011 Link to this post

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

    Posted 23 Feb 2011 Link to this post

    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!
  3. UI for WPF is Visual Studio 2017 Ready
  4. Corey
    Corey avatar
    6 posts
    Member since:
    Feb 2011

    Posted 23 Feb 2011 Link to this post

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

    Posted 25 Feb 2011 Link to this post

    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!
Back to Top