Carousel Get Item position

6 posts, 0 answers
  1. michel
    michel avatar
    1 posts
    Member since:
    Nov 2010

    Posted 08 Nov 2010 Link to this post

    Hello everybody

    I'm using RadCarousel component and I want know if there any method
    in order to get the items position inside radCarousel (x and y).

    I need to retrieve this data when the selected item inside the component has change!

    Thank you!
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 10 Nov 2010 Link to this post

    Hi michel,

    In order to provide you with an appropriate solution, I would need a bit more details about the scenario you want to accomplish. What is the type of the items ? If you want to follow the change of the selected item, can you use the SelectionChanged event ?
     

    Best wishes,
    Maya
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Antonio
    Antonio avatar
    6 posts
    Member since:
    Jun 2012

    Posted 11 Nov 2010 Link to this post

    Thank you very much for your answer,
    but I result the problem by my self!

    However programming RedCarousel I come across different problems like:
    1. How set offset (Code or XAMP) between Carousel items
    2. Calling methods by cliccking over an Carousel items
    3. And define Z-Deep between Carousel items

    Could you help me?
  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 12 Nov 2010 Link to this post

    Hello alex,

    1. Unfortunately, for the time being you cannot control the offset between the items.
    2. You may add a handler for a click event for example and implement the logic you want. I am sending you a sample project illustrating how to handle double-click on an item.
    3. You may play along with the Scale as demonstrated in this example for RadCarouselPanel. Thus you may try to achieve a similar to result as desired. 

    Regards,
    Maya
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Antonio
    Antonio avatar
    6 posts
    Member since:
    Jun 2012

    Posted 15 Nov 2010 Link to this post

    Thank you very much!

    My project is going on thanks your advice!
    I would like to know three more things:

    1. Is possible to increase width and height of the element at the center of the Carousel?
    2. with a timer I'm moving the carousel but when I reach the end I have to change the direction (Right to left) because The carousel doesn't restart this is how I'm doing:

    var panel = this.thumbCarousel.FindCarouselPanel();
     
                        if (directionRight)
                        {
                            panel.MoveBy(1);
                        }
                        else
                        {
                            panel.MoveBy(-1);
                        }
                        if (this.HasReachedEnd())
                            directionRight = false;
                        if (HasReachedStart())
                        {
                            directionRight = true;
                        }
     
                        RadCarouselPanel radP = this.thumbCarousel.FindCarouselPanel();
                        if (radP.TopContainer != null)
                        {
                            radTransCtrl.Content = (IntPtr)(((CarouselItem)radP.TopContainer).Item);
                            updateText();
                        }
    3. in the code showed above "radTransCtrl" is a Transaction control which show the center element of the carousel but it doesn't take it instated it takes the previeus one How is possible?
     
    Thank you!
  7. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 18 Nov 2010 Link to this post

    Hello alex,

    In order to change the size of the center item, you may use scaling. For example:

    <telerik:RadCarousel x:Name="MilanCarousel" Background="Black" >           
        <telerik:RadCarousel.ItemsPanel>
            <ItemsPanelTemplate>
                <telerik:RadCarouselPanel ItemsPerPage="5">
                    <telerik:RadCarouselPanel.ScaleStops>
                        <telerik:PathStopCollection>
                            <telerik:PathStop PathFraction="0.4" Value="1.0"/>
                            <telerik:PathStop PathFraction="0.5" Value="2.0"/>
                            <telerik:PathStop PathFraction="0.6" Value="1.0"/>
                        </telerik:PathStopCollection>
                    </telerik:RadCarouselPanel.ScaleStops>
            </telerik:RadCarouselPanel>
        </ItemsPanelTemplate>
         </telerik:RadCarousel.ItemsPanel>
    </telerik:RadCarousel>

    For further reference, you may take a look at our demo for RadCarousel.
    Considering your second concern, I would need a bit more information. When are you executing the movement ? What is the implementation of the method HasReachedEnd() ?  Any relevant code-snippet and details about your customization would be helpful.

    Kind regards,
    Maya
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for WPF
Back to Top
UI for WPF is Visual Studio 2017 Ready