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

How to stop reloading of radrotator on every item click?

1 Answer 73 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pawan
Top achievements
Rank 1
Pawan asked on 08 Feb 2012, 02:38 PM
Hello,

I am using radrotator having xml datasource to load thumb images in ratator also rotator is having scroll using javascript which rotates thumb images horizontally when I click on scroll button and then click on image in rotator its original image get visible on top of this rotator but the problem is thumb rotator starts again from first image. Even I used the rad ajax panel for this but the problem is same.

Can someone help me how to stop this reloading of radrotator it should show the clicked image.

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 10 Feb 2012, 05:20 PM
Hello Pawan,

There are two options for achieving this:
  • You can use one of the client-side evens OnClientItemClicked and OnClientItemClicking and set the RadRotator property AutoPostBack to false in order to execute your logic on the client. The clicked item will be persisted as there will not be a postback.
  • You can continue to postback the page on item click, in which case the clicked item can be persisted by handling the server-side event of RadRotator OnItemClick, as shown in the code sample below:
    protected void RadRotator1_ItemClick(object sender, RadRotatorEventArgs e)
    {
        RadRotator rotator = sender as RadRotator;
        rotator.InitialItemIndex = e.Item.Index;// Persist the index
    }

I hope this helps.

Regards,
Slav
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
General Discussions
Asked by
Pawan
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or