Disable Click Event for specific item in RadRotator

2 posts, 1 answers
  1. Michael Schneiders
    Michael Schneiders avatar
    1 posts
    Member since:
    Feb 2009

    Posted 19 Jul 2011 Link to this post

    We are using Radrotator as follows:

    <telerik:RadRotator ID="RadRotator_Slider" PauseOnMouseOver="false" runat="server" Skin="cms" EnableEmbeddedSkins="false">

     

    <ItemTemplate>

     

    <asp:Image ID="Image" runat="server" style="cursor:pointer" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "Image") %>' AlternateText="" />

     

    </ItemTemplate>

     

    </telerik:RadRotator>

    When Item is clicked, the following event is called and a redirection to
    specified URL is executed:

     

    Protected Sub RadRotator_Slider_ItemClick(o As Object, e As RadRotatorEventArgs) Handles RadRotator_Slider.ItemClick

    Dim dt As DataTable = Session("DataSource")

    Dim frame As RadRotatorItem = e.Item

    Dim index As Integer = frame.Index

    Dim Link As String = dt.Rows(index).Item("LinkAdress")

    If Link <> "" Then Response.Redirect(Link)

    End Sub


    For some specific items, there is no URL. For those items, I would like to disable the
    itemclick event and if possible, I would also like to change the cursor style when hovering
    over the image back to normal. As a result, no postback action should be executed on items without url.

    Is that possible?

  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Jul 2011 Link to this post

    Hello Michael,

    You can attach OnClientItemClicking and cancel the event based on the item.
    Javascript:
    function OnClientItemClicking(sender, args)
      {
              //Checking for the item and cancel the event
      args.set_cancel(true);
      }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top