Articles in this section
Category / Section

How to add the scrollbar to the Carousel items?

1 min read

User can add the ScrollBar to the Carousel Items. It can be achieved by adding the ScrollViewer control inside the ItemTemplate of Carousel control. The following code demonstrates the same.



<!-- Carousel control -->
<syncfusion:Carousel Height="300" x:Name="carousel" ItemsSource="{Binding Collection}">
<!-- Set Height For Carousel Items -->
<Style TargetType="syncfusion:CarouselItem">
<Setter Property="Height" Value="140" />
<!-- For Adding ScrollBar to Carousel Items -->
<Grid >
<!-- Add ScrollBar  -->
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" >
<Border x:Name="border" >
<Grid Width="150" Height="300">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<TextBox TextWrapping="Wrap" Grid.Row="0"  Background="Green" Foreground="White" 
Text="The Carousel is a circular conveyor used on which objects are displayed and rotated. The Carousel control provides a 3D interface for displaying objects with interactive navigation, Data Binding Path, Items Per Page, Scaling and Skewing."/>
<Image Source="/Images1/dodsworth.png" Grid.Row="1"  />



public class Model
public ObservableCollection<Model> Collection { get; set; }
public ViewModel()
Collection = new ObservableCollection<Model>();
Collection.Add(new Model() );
Collection.Add(new Model() );
Collection.Add(new Model() );
Collection.Add(new Model() );
Collection.Add(new Model() );          





Sample:  CarouselSample


Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied