More in this section

Forums / Developing with Sitefinity / How to get list of categories assigned on dynamicContentListView_ItemDataBound event

How to get list of categories assigned on dynamicContentListView_ItemDataBound event

1 posts, 0 answered
  1. SVA Webmaster
    SVA Webmaster avatar
    85 posts
    Registered:
    18 Jul 2007
    16 Apr 2012
    Link to this post
    I have a custom content type module I've created that has a classification column. Items of this type then have categories assigned to them. I am needing to get a list of the categories assigned to a given item on its ItemDataBound event in a custom widget template using the dynamicContentListView. Below is what I have so far that is giving me conversion errors. Does anyone know how to easily do this? Thanks!

    Protected Sub dynamicContentListView_ItemDataBound(sender As Object, e As Telerik.Web.UI.RadListViewItemEventArgs) Handles dynamicContentListView.ItemDataBound
     
        If e.Item.ItemType = Telerik.Web.UI.RadListViewItemType.AlternatingItem Or e.Item.ItemType = Telerik.Web.UI.RadListViewItemType.DataItem Then
     
            Dim categories As List(Of Guid) = CType(DataBinder.Eval(CType(e.Item, RadListViewDataItem).DataItem, "Category"), List(Of Guid))
     
        End If
     
    End Sub
1 posts, 0 answered