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

Carousel top item

5 Answers 39 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Dhruv
Top achievements
Rank 1
Dhruv asked on 27 Mar 2012, 10:18 AM
hi,
I want to disable the automatic movement of carousel item, which takes the current clicked carousel item to the top container.
thanks

5 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 27 Mar 2012, 10:22 AM
Hi Dhruv,

 
Could you provide a bit more details about the behavior you require? Do you want your items not to be moved in the centered once they are clicked or you just want to remove the animation? 

Kind regards,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Dhruv
Top achievements
Rank 1
answered on 27 Mar 2012, 10:41 AM

I have two items in carousel and it has 2 items per page. But whenever i click on any item it shifts to get the focus. i want to stop that movement. And want to show both the items in my carousel.

i want to stop that shifting of carousel item
0
Maya
Telerik team
answered on 27 Mar 2012, 11:31 AM
Hi,

The behavior you experience is the expected one since when the ItemsPerPage property is set to 2, the topmost position is the one on the right - that is why when you click on the left item, it goes to that top position and the other item moves out of the view port. 
What you can try is to set ItemsPerPage to 3, thus this topmost position will be placed in the center and none of the items will be hidden on a single click.
The other possible approach would be to leave ItemsPerPage set to 2 and set CanUserSelect property of RadCarousel to "False" In that way the carousel will not be scrolled at all on clicking on an item.
I am attaching a sample project illustrating both approaches.
Please take a look at it and let me know whether any of it is appropriate for you scenario.

All the best,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Dhruv
Top achievements
Rank 1
answered on 27 Mar 2012, 02:13 PM
Thanks for the reply Maya.
Actually i have images as the caraousel data, and i want to display enlarged view of data in a different popup by double clicking that.
Canuserselect propert fulfills the first requirement, but how can we acheive the requirement of opening the enlarged view popup can be acheived.
Thanks :)
0
Maya
Telerik team
answered on 27 Mar 2012, 03:34 PM
Hello Dhruv,

You can try handling MouseDoubleClick event. You can get the corresponding item as follows:

private void RadCarousel1_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var clickedElement = e.OriginalSource as FrameworkElement;
            if(clickedElement != null)
            {
                var carouselItem = clickedElement.ParentOfType<CarouselItem>();
                 
            }
        }

Once you have the clicked carousel item, you can display it in a window, popup or whatever element you need. 
Will that approach be suitable for you ? 

Regards,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Carousel
Asked by
Dhruv
Top achievements
Rank 1
Answers by
Maya
Telerik team
Dhruv
Top achievements
Rank 1
Share this question
or