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

Make the Carousel vertical

4 Answers 256 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 22 Sep 2008, 02:11 PM
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?

4 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 23 Sep 2008, 07:14 AM
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.
0
Scott
Top achievements
Rank 1
answered on 23 Sep 2008, 02:34 PM
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!



0
Accepted
Milan
Telerik team
answered on 24 Sep 2008, 10:37 AM
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.
0
Scott
Top achievements
Rank 1
answered on 24 Sep 2008, 01:47 PM
That worked! Thanks!   
Tags
Carousel
Asked by
Scott
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Scott
Top achievements
Rank 1
Milan
Telerik team
Share this question
or