Sample Code to Add Clickable Links to RadRotator

Thread is closed for posting
2 posts, 0 answers
  1. 4C5D0905-971D-49F0-823C-016661DE5AE4
    4C5D0905-971D-49F0-823C-016661DE5AE4 avatar
    26 posts
    Member since:
    Aug 2006

    Posted 03 Nov 2011 Link to this post


    RadControls version    Q2 2011
    .NET version 4.0
    Visual Studio version  2010
    programming language VB
    browser support

    all browsers supported by RadControls

    I needed to put a news section in our desktop app to mirror a news feed on our website.  The news comes in a data table with a column for description and one for link. I used the following code to make this work.  This is very simplified, I just couldn't find a place to do it and figured I'd share.  

    In the form_load

     Dim dt As DataTable = {YOUR DATATABLE}
            For x As Integer = 0 To dt.Rows.Count - 1
    	'Create Link
                Dim news As New LinkLabel
                news.Text = dt.Rows(x).Item("Description")
                news.Links.Add(0, dt.Rows(x).Item("Description").ToString.Length, dt.Rows(x).Item("Link"))
    	'Add Handler for the Click
                AddHandler news.LinkClicked, AddressOf News_LinkClicked
    	'Add item to Rotator
                Dim rditm As New RadHostItem(news)
    Then you need to add the function to open the link
      Private Sub News_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs)
        End Sub
  2. 907A8354-5E2E-4F69-95E6-B00F38D8C271
    907A8354-5E2E-4F69-95E6-B00F38D8C271 avatar
    1805 posts
    Member since:
    Jan 2017

    Posted 09 Nov 2011 Link to this post

    Hi Jeff,

    Thank you for sharing your approach with the community. I have updated your Telerik points for it.

    All the best,
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.