【问题标题】:How to get bind a (WPF or Infragistics) DataGrid to a List<List<string>> or List<string[]>?如何将(WPF 或 Infragistics)DataGrid 绑定到 List<List<string>> 或 List<string[]>?
【发布时间】:2009-08-22 13:16:14
【问题描述】:

我需要将字符串集合中的字符串集合绑定到 DataGrid (Infragistics)。

但是,当我这样绑定它时:

<DataPresenter:XamDataGrid x:Name="xamDataGrid" DataSource="{Binding TheCollection}">

到此:

public List<string[]> TheCollection

或者这个:

public List<List<string>> TheCollection

我明白了:

我需要使用哪种 .NET 类型才能在集合中将这个集合显示为网格,即像这样:

bank11  1111111
bank12  2222222

我不能使用自定义对象,因为它被一个不能引用其他模块并且必须接受简单 .NET 类型的模块使用。

【问题讨论】:

    标签: wpf xaml datagrid mvvm


    【解决方案1】:

    我想你想使用Dictionary&lt;String,String&gt;

    【讨论】:

      猜你喜欢
      • 2014-01-31
      • 2013-12-07
      • 2011-02-21
      • 2017-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-10
      • 2015-01-02
      相关资源
      最近更新 更多