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.
David
Top achievements
Rank 1
David asked on 07 Feb 2009, 03:17 PM

Hello

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

Here's the code

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

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

1 Answer, 1 is accepted

Sort by
0
Milan
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"/>  
</Style> 

Hope this works.

Regards,
Milan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or