2016-03-24 22 views
0

私はUIで辞書を編集したい辞書辞書をデータグリッドに含めるにはどうすればいいですか?

private Dictionary<int, data> mdata = new Dictionary<int, data>(); 

を持っています。

私はDataGridViewでの使用が可能だと思います。

辞書のデータをDataGridViewに挿入する方法と、辞書に戻って編集する方法はありますか。

+1

どのようなUIフレームワークですか?どのデータグリッドが正確に? – Dennis

+0

http://stackoverflow.com/questions/5204423/filling-wpf-datagrid-in-c-sharp-with-a-dictionary-string-string – Yanshof

+0

「データガード」のようなものはありません。あなたのやることに応じて、DataGridとGridViewとDataGridViewがあります。 Winforms? DataGridViews!あなたは[this](http://stackoverflow.com/questions/1928567/using-a-dictionary-in-a-propertygrid)を見ましたか? – TaW

答えて

0
dataGridView.DataSource = (from d in dictionary 
          orderby d.Value 
          select new 
           { 
           d.Key, 
           d.Value 
          }).ToList(); 
+0

これで、編集した値を書き戻すことはありません。 – stuartd

関連する問題