Carousel top item

6 posts, 0 answers
  1. Dhruv
    Dhruv avatar
    15 posts
    Member since:
    Nov 2011

    Posted 27 Mar 2012 Link to this post

    hi,
    I want to disable the automatic movement of carousel item, which takes the current clicked carousel item to the top container.
    thanks
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 27 Mar 2012 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dhruv
    Dhruv avatar
    15 posts
    Member since:
    Nov 2011

    Posted 27 Mar 2012 Link to this post


    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
  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 27 Mar 2012 Link to this post

    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 >>
  6. Dhruv
    Dhruv avatar
    15 posts
    Member since:
    Nov 2011

    Posted 27 Mar 2012 Link to this post

    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 :)
  7. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 27 Mar 2012 Link to this post

    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 >>
Back to Top
UI for WPF is Visual Studio 2017 Ready