Problem with carousel

2 posts, 0 answers
  1. David
    David avatar
    9 posts
    Member since:
    Jan 2009

    Posted 07 Feb 2009 Link to this post


    I want to make carousel items 100% width, but unable to achieve that. Any help would be appreciated.

    Here's the code

    <DataTemplate DataType="{x:Type local:XTraItem}">
    <Grid Grid.Column="0" Grid.Row="0" Width="1000">
    <ColumnDefinition Width="100"/>
    <ColumnDefinition Width="900"/>

    <Image Source="{Binding Path=ImageURI}" Grid.Column="0" Grid.Row="0" />
    <TextBlock Text="{Binding Path=Name}" Foreground="AliceBlue" Grid.Column="1" Grid.Row="0" />
    <telerik:RadCarousel x:Name="XTraCarousel" AutoGenerateDataPresenters="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>

  2. Milan
    Milan avatar
    1989 posts

    Posted 10 Feb 2009 Link to this post

    Hello David,

    If I have understood your question correctly, the carousel items coud not be resized to the width of 1000. That is because by default the CarouselItem class has a MaxWidth set. In order to be able to resize the carousel item you should set MaxWidth and Width properties in a global style like that:

    <Style TargetType="{x:Type telerik:CarouselItem}">  
        <Setter Property="MaxWidth" Value="1000"/>  
        <Setter Property="Width" Value="1000"/>  

    Hope this works.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top