Make the Carousel vertical

5 posts, 1 answers
  1. Scott
    Scott avatar
    43 posts
    Member since:
    Nov 2007

    Posted 22 Sep 2008 Link to this post

    I have a collection of images that I am currently displaying in a listbox.  I'd like to use the carousel, but vertical, not horizontal.   Do I still use a listbox for this?
  2. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 23 Sep 2008 Link to this post

    Hi Scott,

    We have two controls that could help you achieve your task - RadCarousel and RadCarouselPanel.

    RadCarouselPanel is the lighter control. It can be used as an ItemsPanel for other Itemscontrol ( such as ListView or ListBox).

    RadCarousel is the heavier control. Using this one you will not need a ListBox or other container. You may directly bind it to your items.

    Determining which one to use depends on your particular needs. If you need additional assistance, don't hesitate to contact us giving some details on your approach.

    The RadCarouselPanel has  a customizable Path property which tells the control the direction and the trajectory of the items movement. Thus, you can achieve vertical movement of the items by simply setting the Path property.

    If you prefer to use the RadCarousel instead, you can still set the Path property using the following syntax.
    RadCarousel1.FindCarouselPanel().Path = path; 

    If you have any difficulties with the described approaches,  please let us know and we will provide sample code.

    Sincerely yours,
    Pavel Pavlov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Scott
    Scott avatar
    43 posts
    Member since:
    Nov 2007

    Posted 23 Sep 2008 Link to this post

    thanks for the explanation.  I took my existing listbox and added an ItemsPanelTemplate.  I now get the carousel in my listbox.

    However, now I want to make it follow a path, so I added code to set the path

    this.radCarouselPanel.IsPathVisible = true
    this.radCarouselPanel.ItemsPerPage = 20
    this.radCarouselPanel.Path = (Path)this.FindResource("SerpentinePath"); 

    However, I get compile errors saying my page does not contain a definition for radCarouselPanel.   My xaml for my ListBox is here:

    <ListBox x:Name="lstThumbs" Grid.Row="2"   ItemContainerStyle="{DynamicResource ThumbNailContainerStyle}" MouseRightButtonUp="lstThumbs_MouseRightButtonUp" SelectionChanged="lstThumbs_SelectionChanged" MouseDown="lstThumbs_MouseDown"
                <ListBox.ItemsPanel> 
                    <ItemsPanelTemplate> 
                        <Controls1:RadCarouselPanel x:Name="radCarouselPanel">      
                        </Controls1:RadCarouselPanel> 
                    </ItemsPanelTemplate> 
                </ListBox.ItemsPanel> 
            </ListBox> 

    It shows in intellisense, but will not compile.

    Please help! Thanks!



  5. Answer
    Milan
    Admin
    Milan avatar
    1989 posts

    Posted 24 Sep 2008 Link to this post

    Hello Scott,

    Getting the instance of the RadCarouselPanel that you use as ItemsPanel is not straightforward and requires a little bit of extra work. Although you set a name for RadCarouselPanel, WPF won't let you directly access it using this.radCarouselPanel - you have to search the visual tree for it.
    I've attached a sample project that demonstrates how to find the panel.

    Best wishes,
    Milan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Scott
    Scott avatar
    43 posts
    Member since:
    Nov 2007

    Posted 24 Sep 2008 Link to this post

    That worked! Thanks!   
Back to Top
UI for WPF is Visual Studio 2017 Ready