2017-04-03 125 views
0

绑定到词典我发现这一点:的DataGridView在vb.net

var _priceDataArray = from row in _priceData select new { Item = row.Key, Price = row.Value }; 

现在我在vb.net尝试这样做:DataGridView bound to a Dictionary

的一个解决方案到DataGridView到词典在下面的C#代码绑定使用C#转换为vb.net。该转换器给我以下内容:

Dim _priceDataArray = From row In _priceDataNew With { _ 
Key .Item = row.Key, _ 
Key .Price = row.Value} 

但是,这并不奏效。 声明的错误消息:“预计声明结束”

有什么想法?

回答

0

转换应该是:

Dim _priceDataArray = 
    From row In _priceDataNew 
    Select New With { 
     Key .Item = row.Key, 
     Key .Price = row.Value 
    }