我有一本我想在表單中顯示的字典。 最簡單的方法是什麼?c#:如何輕鬆顯示字典<string, int>?
最好我想展示一個控件,我可以使用int值進行排序。 我試過一個DataGridView,但沒有顯示出來,我必須做一些錯誤的...
代碼:
mDataGridView.DataSource = mWordCount;
/*Where mWordCount is the Dictionary<string, int> but nothing shows up. (It's a forms-app, not a web-app)*/
「,我一定在做錯事......)」 - 也許你可以發佈你的代碼給人們一個線索? – 2010-01-29 01:09:30
對不起,當然我應該發佈我的代碼:) mDataGridView.DataSource = mWordCount; 其中mWordCount是詞典 但沒有顯示出來。 (這是一個表單應用程序,而不是一個web應用程序) –
Led
2010-01-29 01:11:06
嘗試'mWordCount.ToList()',看看會發生什麼。 – 2010-01-29 01:12:25