How to get list of categories assigned on dynamicContentList

Posted by Community Admin on 04-Aug-2018 19:45

How to get list of categories assigned on dynamicContentListView_ItemDataBound event

All Replies

Posted by Community Admin on 16-Apr-2012 00:00

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

This thread is closed