Tagcloud in a repeater

2 posts, 0 answers
  1. d
    d avatar
    2 posts
    Member since:
    Mar 2011

    Posted 06 Mar 2011 Link to this post

    Hello there

    I am unable to render the tagcloud in a repeater; it generates the following exception:

    Exception type: NullReferenceException

    Exception message: Object reference not set to an instance of an object.

    at Telerik.Web.UI.RadTagCloud.BindToEnumerableData

    I have added some code below to replicate. In this example I have bound the repeater to a simple list.



    <%@ Page Language="VB" %>
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <script runat="server">
      
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
      
            If Not IsPostBack Then
                  
                Dim oDatasource As New List(Of String)
                oDatasource.Add("Item 1")
                oDatasource.Add("Item 2")
                oDatasource.Add("Item 3")
                oDatasource.Add("Item 4")
              
                rp.DataSource = oDatasource
                rp.DataBind()
      
            End If
        End Sub
          
    </script>
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:Repeater ID="rp" runat="server">
                <ItemTemplate>
                    <telerik:RadTagCloud ID="RadTagCloud1" runat="server" Width="400px">
                        <Items>
                            <telerik:RadTagCloudItem Text="ASP.NET" Weight="12" />
                            <telerik:RadTagCloudItem Text="AJAX" Weight="134" />
                        </Items>
                    </telerik:RadTagCloud>
                </ItemTemplate>
            </asp:Repeater>
        </div>
        </form>
    </body>
    </html>
  2. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 09 Mar 2011 Link to this post

    Hello,

    This is a known issue of the TagCloud control and it is already fixed. You should download the latest internal build or the Q1 2011 Beta release, where the fix is available.

    Best wishes,
    Pero
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top