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

Disable Click Event for specific item in RadRotator

1 Answer 64 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Michael Schneiders
Top achievements
Rank 1
Michael Schneiders asked on 19 Jul 2011, 06:09 PM
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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 21 Jul 2011, 05:28 AM
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.
Tags
Rotator
Asked by
Michael Schneiders
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or