Hello,
I have a database with the columns NewsID, date, category, title and content. I want to show the date, category and title in a Telerik Listview. When you click on the title (which is a hyperlink in the listview), I want to load a subpage with the full article (title+content). In which subpage it is loaded, depends on the category of the article. When the category is for example 'general', it is loaded in the default-page. When the category is 'dogs', it is loaded in subpages/dogs.aspx. When the category is 'fishes', it is loaded in subpages/fishes.aspx.
When I use a standard datalist, I do it in the following way:
What is the solution for this problem when I use a Telerik-listview instead of a standard datalist?
Thanks in advance.
I have a database with the columns NewsID, date, category, title and content. I want to show the date, category and title in a Telerik Listview. When you click on the title (which is a hyperlink in the listview), I want to load a subpage with the full article (title+content). In which subpage it is loaded, depends on the category of the article. When the category is for example 'general', it is loaded in the default-page. When the category is 'dogs', it is loaded in subpages/dogs.aspx. When the category is 'fishes', it is loaded in subpages/fishes.aspx.
When I use a standard datalist, I do it in the following way:
| Protected Sub DataList_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList.ItemDataBound |
| Select Case e.Item.ItemType |
| Case ListItemType.Item, ListItemType.AlternatingItem |
| Dim myRow As DataRowView = CType(e.Item.DataItem, DataRowView) |
| Dim hype As HyperLink = e.Item.FindControl("DatalistHyperlink") |
| If myRow.Item("category") = "General" Then |
| hype.NavigateUrl = "default.aspx?NewsID=" & myRow.Item("NewsID") |
| Else |
| hype.NavigateUrl = "subpages/" & myRow.Item("category") & ".aspx?NewsID=" & myRow.Item("NewsID") |
| End If |
| End Select |
| End Sub |
What is the solution for this problem when I use a Telerik-listview instead of a standard datalist?
Thanks in advance.