0

I found this: DataGridView bound to a Dictionary

One solution to bind the Datagridview to a Dictionary is the following C# code:

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

Now I tried this in vb.net using a C# to vb.net converter. The converter gives me the following:

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

However, this doesnt work. Error Message on the with statement: "end-of-statement expected"

Any thoughts?

Community
  • 1
  • 1
JoP
  • 45
  • 1
  • 7

1 Answers1

0

The conversion should be:

Dim _priceDataArray =
    From row In _priceDataNew
    Select New With {
        Key .Item = row.Key,
        Key .Price = row.Value
    }
Mark
  • 8,140
  • 1
  • 14
  • 29