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

Carousel Get Item position

5 Answers 186 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
michel
Top achievements
Rank 1
michel asked on 08 Nov 2010, 06:05 PM
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!

5 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 10 Nov 2010, 01:15 PM
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
0
Antonio
Top achievements
Rank 1
answered on 11 Nov 2010, 04:39 PM
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?
0
Maya
Telerik team
answered on 12 Nov 2010, 10:34 AM
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
0
Antonio
Top achievements
Rank 1
answered on 15 Nov 2010, 03:15 PM
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!
0
Maya
Telerik team
answered on 18 Nov 2010, 01:34 PM
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
Tags
Carousel
Asked by
michel
Top achievements
Rank 1
Answers by
Maya
Telerik team
Antonio
Top achievements
Rank 1
Share this question
or