yeah no one aswers i do it myself this is now resolved
you can take that to the bank ...Code:'read in xml for use Dim xd As XDocument = XDocument.Load(pathToMain & "Recources\SitesGallery.xml") Dim appinfo = From info In xd.Descendants("application") _ Select New With _ { _ .packageid = info.Element("packageid").Value, _ .packageType = info.Element("packageType").Value, _ .version = info.Element("version").Value, _ .feedURL = info.Element("feedURL").Value, _ .image = info.Element("image").Value _ } Dim group = appinfo.GroupBy(Function(value) value.packageType) Dim lv As ListViewItem Dim itm As ListViewItem lv = New ListViewItem() lv.Text = "All" Me.LVCategories.Items.Add(lv) With LVCategories For Each node In appinfo itm = .FindItemWithText(node.packageType, True, 0, True) If itm Is Nothing Then lv = New ListViewItem() For Each grp In group If grp(0).packageType = node.packageType Then lv.Text = node.packageType & " (" & grp.Count & ")" End If Next Me.LVCategories.Items.Add(lv) End If Next End With LVCategories.Items.Item(0).Selected = True lv = Nothing itm = Nothing




Reply With Quote
