We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Carousel control with custom path and a circular linked List

Hello,

I am using the carousel control with a custom path. With the setting VisualMode="CustomPath", the control looses its nice carousel behavior (you can't click through its items in one direction without reaching an end anymore). I tried to fix this problem by moving the elements in the ObservableCollection, which is used as ItemsSource, from the end to the beginning of the list or vice versa (depending on which direction the carousel turns). Unfortunately It doesn't work as desired.

When i run the application, I get an an:

 "unhandeled exception of type 'System.ArgumentOutOfRangeException' occurred in PresentationCore.dll. Additional information: Specified argument was out of the range of valid values."

Here is my method, which runs after each SelectedIndexChanged event:

        internal void AdjustCollection(Carousel Carousel)
        {
            carousel = Carousel;
            //Coll is the ObservableCollection used as ItemsSource
            int center_index = Coll.Count / 2 + 1;
            int selected_index = Carousel.SelectedIndex;
            if (selected_index > center_index)
            {
                while(selected_index != center_index)
                {
                    Coll.Move(0,Coll.Count-1);
                    selected_index--;
                }
            }
            else
            {
                while (selected_index != center_index)
                {
                    Coll.Move(Coll.Count-1,0);
                    selected_index++;
                }
            }
        }

Does anyone have an idea of what I am doing wrong or how I can reach my goal in another way?

Kind regards,

Janosch

Attachment: CarouselSample_1a3cb908.zip

3 Replies

VR Venkateshwaran Ramdoss Syncfusion Team February 26, 2016 09:34 AM UTC

Hi Janosch,

We have analyzed your sample. In this you have updated the Carousel item in circular path using the CustomPath. We can update the Carousel item in circular path by using 'VisualMode=Standard'. We have created sample for the same and RotationAngle is set to 90. Please download the sample from the below link.

Sample: CarouselSample

Regards,
Venkateshwaran V.R.


JK Janosch Kunczik February 26, 2016 03:43 PM UTC

Hello Venkateshwaran,

Thank you again for the great support! This is exactly the behavior I needed.

Kind regards,

Janosch


AP Ashwini Paranthaman Syncfusion Team February 29, 2016 05:42 AM UTC

Hi Janosch,
Thank you for the update.
We are glad that your issue has been resolved.
Please let us know if you need any other assistance.
Regards,
Ashwini P.

Loader.
Live Chat Icon For mobile
Up arrow icon