通常のプロパティの横にプロパティ値(プロパティバッグ)ディクショナリを含むクラスがあります。MvcContribのグリッドを使用して、このオブジェクトのコレクションをテーブルに表示したいと思います。
クラス:
public class ObjectWithPropertyBag
{
public string Property1 { get; set; }
public string Property2 { get; set; }
public Dictionary<string, string> PropertyBag { get; set; }
}
私のGridModel(ObjectWithPropertyBagGridModel):
Column.For(x => x.Property1);
Column.For(x => x.Property2);
Column.For(x => x.PropertyBag)//how to display keys as columns and values as table data
私の見解:
Html.Grid(ViewData.Model.ObjectWithPropertyBag).WithModel(new ObjectWithPropertyBagGridModel())
辞書を反復処理して列を作成する方法はありますか?
ありがとう。