Svideo (21) [Avatar] Offline
#1
I'm having an issue with binding I think. This code works in debug but fails in release.

Dim MyDictionaryQuery = From ABC As MetaDataFilePath In Form1.StockDataPathIEnum _
Group ABC By FirstLetter = (ABC.TickerSymbol(0)) _
Into MyDictionary = Group _
Order By FirstLetter _
Select FirstLetter, MyDictionary


MetaStockTreeView.Nodes.Clear()
MetaStockTreeView.BeginUpdate()

Dim MyIndex As Integer = 0

For Each Metaobj In MyDictionaryQuery
MetaStockTreeView.Nodes.Add(New TreeNode(Metaobj.FirstLetter))
For Each SymbolEntry As MetaDataFilePath In Metaobj.MyDictionary
'Console.WriteLine(vbTab & SymbolEntry.TickerSymbol & vbTab & SymbolEntry.StockName)
MetaStockTreeView.Nodes(MyIndex).Nodes.Add(New TreeNode(SymbolEntry.StockName & " (" & SymbolEntry.TickerSymbol & ")"))
Next
MyIndex = MyIndex + 1
Next

MetaStockTreeView.EndUpdate()


I suspect I'm missing on how the the result of the query needs to be cast or that I should be creating a class to project the results into? The results of course don't show up in intellisense and that would be nice.

The Firstletter ends up being a char and I can find the syntax to cast it back.

I know I stuck on stupid on this one, so any suggestions?

This should be a fairly useful pattern where a list of objects get alphabetically shorted into groups by the first letter and put in a treeview but I haven't seen any examples in vb.