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

CoverFlow "Main" Item Content Change

2 Answers 41 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Turok
Top achievements
Rank 1
Turok asked on 25 Mar 2011, 06:38 PM
Hi, is there a way to change the item "main" (the one in the middle, don't know how to call it) content?

E.g.:
I have soccer teams pictures in the coverflow, but when an image goes to the middle, I want to change its content.

Probably OnClientItemShown event should be used, right? But I want to show some data from DB, so is there a way how to do this on server side so I can code it in C#?

Thank you

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 28 Mar 2011, 10:59 AM
Hello Turok,


Probably, you can invoke an ajaxRequest() to execute your server code to change the image for Rotator item.

Attach the "OnClientItemShown"  client event as you thought. Now from the client side event handler, call the ajaxRequest(). Now in the "RadAjaxManager_AjaxRequest()" event, get reference to the corresponding rotator item and perform the necessary change. You will have to pass the index of RadRotator item to server side (when invoking the ajaxRequest() ) to identlfy the corresponding item.

I hope the suggestion help you.


Thanks,
Princy.
0
Niko
Telerik team
answered on 29 Mar 2011, 02:45 PM
Hello Turok,

There is one more option that you can go with. In the ItemTemplate add a hidden <div> element with a css class of extraData, for example. In the OnClientItemShown event you can try showing this extra element, keeping in mind that you will need to hide the extra element of the item that is being replaced as current. Here is an example how this may be implemented:
function RotatorClientItemShown(sender, args)
{
    var item = args.get_item();
    $telerik.$("div.extraData:visible").hide();
    $telerik.$(item.get_element()).find("div.extraData").show();
}

Hope this will be of help to you as well.

Best wishes,
Niko
the Telerik team
Tags
Rotator
Asked by
Turok
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Niko
Telerik team
Share this question
or