RadRotator OnItemClick change img src

2 posts, 0 answers
  1. Michael
    Michael avatar
    19 posts
    Member since:
    Dec 2011

    Posted 05 Nov 2013 Link to this post


    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">
                            <asp:Image ID="myImage" Width="190px" Height="180px" runat="server" ImageUrl='<%# Container.DataItem %>' AlternateText='<%# VirtualPathUtility.GetFileName(Container.DataItem.ToString()) %>' />

    Would appreciate some help!

  2. Slav
    Slav avatar
    1359 posts

    Posted 08 Nov 2013 Link to this post

    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.

    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.
Back to Top