0
일반 속성 옆에 속성 값 (속성 모음) 사전이 포함 된 클래스가 있습니다. MvcContrib에서 그리드를 사용하여 테이블에이 개체의 컬렉션을 표시하고 싶습니다.사전 및 목록과 함께 MvcContrib Grid 사용
클래스 :
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())
이 사전을 통해 반복하고 열을 만들 수있는 방법이 있나요 ?
감사합니다. 같은
코드를 아무리 해킹해도 문제가되지 않습니다. –