0

Hi all,

I'm making an application that reads RSS Feeds from several sites. Now I want it to put it in a ListView but I can't put it in the different columns.
All the data goes to the first column and I don't want that, I want it to also put it in other columns

My code :

Dim xdoc As XDocument = XDocument.Load("url")

            Dim query = From rssFeed In xdoc.Descendants("item") _
                        Select Title = rssFeed.Element("title").Value, _
                           Description = rssFeed.Element("description").Value, _
                           Link = rssFeed.Element("link").Value
            For Each item In query

                ListView1.Items.Add("TITLE: " + item.Title)
                ListView1.Items.Add("DESCRIPTION: " + item.Description)
                ListView1.Items.Add("LINK: " + item.Link)
            Next
        End If

Thanks,

Vhyr

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Oxiegen
0

Assuming that you already have three columns in the listview.
Here's how you can do that.

Dim xdoc As XDocument = XDocument.Load("url")

Dim query = From rssFeed In xdoc.Descendants("item") _
Select Title = rssFeed.Element("title").Value, _
Description = rssFeed.Element("description").Value, _
Link = rssFeed.Element("link").Value

For Each item In query
   Dim item As New ListViewItem("TITLE: " & item.Title)
   item.SubItems.Add("DESCRIPTION: " + item.Description)
   item.SubItems.Add("LINK: " + item.Link)
   ListView1.Items.Add(item)
Next
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.