You can do that fairly easily as you'll see below. Unfortunately, there isn't a 'FindList()' function to get the single list you are looking for, however, a simple traversing of your full set of Sitefinity Lists and you can pick out the one you are looking for.
Dim mgrList As New Telerik.Lists.ListManager() Dim guidListId As Guid = Nothing Dim objLists As IList = mgrList.GetLists() Dim objList As Telerik.Lists.INamedList Dim objListItem As Telerik.Lists.IListItem Dim objListItemId As Guid = Nothing Dim strHeadline As String = "" Dim strContent As String = "" ' Get all the lists For Each objList In objLists ' Find the one list you are after If objList.Name = mstrListName Then ' Found the list we want, so keep track of the list's id for future reference guidListId = objList.ID ' Walk the set of items within the desired list For Each objListItem In objList.Items ' Get the Title and Content to work with strHeadline = objListItem.Headline strContent = objListItem.Content .... Next Exit For ' Found the one we wanted, don't bother with the other Lists in the set End If Next
RadEditor - please enable JavaScript to use the rich text editor.
I often get asked why I'm willing to journal all of my Sitefinity discoveries. People think I'm insane to give away for free what I labored over at some point.
Let me answer that in 2 parts:
Talk to us about how we can help YOU!
Keep up with our Sitefinity discoveries! Click on the RSS feed icon below or sign up for our newsletter.