Carousel having only 2 items

2 posts, 0 answers
  1. Jog Rad
    Jog Rad avatar
    15 posts
    Member since:
    Nov 2011

    Posted 21 Dec 2011 Link to this post


    I have an issue regarding the display of items if ItemsPerPage is set to 2 and the carousel ItemSource have 2 items only. Yes it displayed the 2 items properly, however when I try to click the 2nd item, the first item is moved to the background (i.e. not displayed). And  when I tried to click again the 2nd item, my expected behavior is that the 1st item would show up but it doesn't.

    Note: Vertical and Horizontal scroll bars are set to hidden because we don't want to use those.
  2. Maya
    Maya avatar
    4062 posts

    Posted 22 Dec 2011 Link to this post


    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,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top