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

Sliding Multiple Itemplates

7 Answers 62 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Sufyan
Top achievements
Rank 1
Sufyan asked on 12 Sep 2011, 12:49 PM
Hi, 
I am using rad rotator and have 7 item templates with a single image in every itemtemplate... When it rotates the image will scroll one by one.. working fine .. 
Now I have an scenario I have numeric buttons outside the rotator like with caption 1 2 3 4 5 6 7... I want to achieve that if the rotator is on image 3 just suppose and user click button with caption 7 then the rotator should rotate 4 images (4 images visibly slide) and stops at image 7... 


Can you help me how can I achieve this through Client Side API function, any routine or function .. 

Thanks in Advance .. 

7 Answers, 1 is accepted

Sort by
0
Sufyan
Top achievements
Rank 1
answered on 12 Sep 2011, 01:33 PM
Hello any one there .. please help regarding above discussed issue ... 
0
Niko
Telerik team
answered on 12 Sep 2011, 04:01 PM
Hello Sufyan,

The most important method that you need to use in your implementation is the showNext rotator method. It takes as a first parameter the direction in which to rotate. Here is a link to the help article on the topic - http://www.telerik.com/help/aspnet-ajax/rotator-client-side-api.html.
Still there is one very tricky part when trying to iterate among the items with showNext - in order to work correctly you should wait for the previous rotation to complete. For that you should attach to the OnClientItemShown method in case it is necessary call the showNext method again.
Please, find attached a sample page with the above described implementation.

Hope this helps.

All the best,
Niko
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sufyan
Top achievements
Rank 1
answered on 13 Sep 2011, 07:31 AM
Hello Niko,

Thank you for your reply. I have tried the solution you provided but it works fine for 3 objects. When I add 4 or 5th object It did not slide 3 or 4 images. 
Do I add something to make it work or any help ?


Thank you in Advance

Sufyan 
0
Accepted
Niko
Telerik team
answered on 13 Sep 2011, 09:52 AM
Hello Sufyan,

Yes, I now noticed this behavior. In that case we will need to change the strategy. As the result should be a very much customized management of the rotator, then the better option is to change the RotatorType to FromCode. After that all manipulations on the rotator should happen through a custom code. Please, find attached a sample implementation with the changed approach.

Hope this helps.

Regards,
Niko
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sufyan
Top achievements
Rank 1
answered on 13 Sep 2011, 11:54 AM
Thank you Niko .. Now its working Fine ... 
0
Yosep
Top achievements
Rank 1
answered on 14 Sep 2011, 01:56 PM
Hi I've read the code but it supports C language, can you help me to convert this script to VB language , because I got a problem since a create the new instance using a therotator.datasource = "I think this is the image path" but how could I name for the id thank you very much , I already tried using a class but it didn't work .

theRotator.DataSource = new[]
        {
            new { image = "~/content/motorcycles/1.png", id = 1 },
                new { image = "~/content/motorcycles/2.png", id = 2 },
            new { image = "~/content/motorcycles/3.png", id = 3 },
            new { image = "~/content/motorcycles/4.png", id = 4 },
            new { image = "~/content/motorcycles/5.png", id = 5 },
            new { image = "~/content/motorcycles/6.png", id = 6 }
        };

How could this code translated in VB language. Thank you very much
0
Slav
Telerik team
answered on 15 Sep 2011, 03:29 PM
Hi Yosep,

The following code sample will help you implement the requested functionality into a VB project:
theRotator.DataSource = New Object () {New With { _
        .image = "~/content/motorcycles/1.png", _
        .id = 1 _
    }, New With { _
        .image = "~/content/motorcycles/2.png", _
        .id = 2 _
    }, New With { _
        .image = "~/content/motorcycles/3.png", _
        .id = 3 _
    }, New With { _
        .image = "~/content/motorcycles/4.png", _
        .id = 4 _
    }, New With { _
        .image = "~/content/motorcycles/5.png", _
        .id = 5 _
    }, New With { _
        .image = "~/content/motorcycles/6.png", _
        .id = 6 _
    }}

I noticed that you have sent also a support ticket on the matter at hand. Please use only one ticket for a particular problem so that we are able to keep track of the discussion and to answer your requests much faster. That being said, let us continue our conversation in the support ticket that you have opened.

Kind regards,
Slav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
Tags
Rotator
Asked by
Sufyan
Top achievements
Rank 1
Answers by
Sufyan
Top achievements
Rank 1
Niko
Telerik team
Yosep
Top achievements
Rank 1
Slav
Telerik team
Share this question
or