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

RadRotator OnItemClick change img src

1 Answer 15 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 05 Nov 2013, 03:31 PM
Hello,

I would like to change an image src to the image that i click on in radrotator.

<img id="propImg" runat="server" src="" />
 
<telerik:RadRotator ID="thumbRotator" runat="server" BackColor="Transparent" OnItemClick="viewImage"  EnableRandomOrder="true" BorderStyle="NotSet" BorderWidth="0" BorderColor="Transparent"
PauseOnMouseOver="true" RotatorType="CoverFlowButtons" Width="430" Height="180" ItemHeight="190px" ItemWidth="200px" FrameDuration="1"  ScrollDirection="Left, Right" Skin="MetroTouch">
                    <ItemTemplate>
                        <asp:Image ID="myImage" Width="190px" Height="180px" runat="server" ImageUrl='<%# Container.DataItem %>' AlternateText='<%# VirtualPathUtility.GetFileName(Container.DataItem.ToString()) %>' />
                    </ItemTemplate>
                 </telerik:RadRotator>


Would appreciate some help!

Thanks!

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 08 Nov 2013, 09:26 AM
Hi Michael,

In the handler of the server-side event ItemClick, you can access the clicked item via the arguments parameter, locate the image inside and change its ImageUrl. For your convenience I have attached a sample project that demonstrates this approach. Please use it to achieve the desired functionality.

Regards,
Slav
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Rotator
Asked by
Michael
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or