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

Problem with carousel

1 Answer 18 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
David asked on 07 Feb 2009, 03:17 PM


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"/>

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 10 Feb 2009, 03:07 PM
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.
General Discussions
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question