views:

1007

answers:

2

I have a dictionary item as below

Dictionary<string, List<StrikePrice>>

where

public class StrikePrice
{
    public string Strike { get; private set; }
    public string Price { get; private set; }

    public StrikePrice(string strike, string price)
    {
        Strike = strike;
        Price = price;
    }
}

and I wish to assign this dictionary to the DataGridView

this.dataGridViewTest.DataSource = listSmiles;

I understand that a dictionary can't be assigned to the the datasource as this doesn't derive from the IList interface.

Is there any way I can assign this dictionary element to the datagrid?

A: 

If the question relates to WPF or silverlight, this article gives a solution.

I've been using it and it performs well, even for large numbers of columns.

Phillip Ngan
@Phillip:This is for Winforms application.
tush1r
+1  A: 

Have you tried using the Values property of the Dictionary?

this.dataGridViewTest.DataSource = listSmiles.Values
Kane
@Kane:I tried doing this, however this didn't work.
tush1r