DataGrid
을 WPF의 제네릭 목록에 바인딩하려고합니다.DataGrid를 WPF의 제네릭 목록에 바인딩하는 가장 좋은 방법
내 목록에있는 데이터의 각 행에 대해 빈 행에 다음 코드 결과는 (i가 5 개 행이있는 경우 즉, 그것은 5 개 행을 표시하지만 셀에 데이터 표시되지 않음) :
List<DataRow> DataBindingSource = GuestList.Where(row =>
(row.Field<long>("FK_GROUP_ID") == Int64.Parse(cmbGroup.SelectedValue.ToString())) &&
(row.Field<long>("FK_AGE_GROUP_ID") != (int)L_Age_Group.Child))
.ToList();
gvwAddultDetails.ItemsSource = DataBindingSource;
을
내 개체 목록을 DataTable
으로 변환하면 작동합니다 (데이터 표시).
List<DataRow> DataBindingSource = GuestList.Where(row =>
(row.Field<long>("FK_GROUP_ID") == Int64.Parse(cmbGroup.SelectedValue.ToString())) &&
(row.Field<long>("FK_AGE_GROUP_ID") != (int)L_Age_Group.Child))
.ToList();
gvwAdultDetails.ItemsSource = DataBindingSource.CopyToDataTable().DefaultView;
하지만이 List<DataRow>
이 있다면, 어떻게 그것이 DataTable
로 변환합니다 : 예를 들어?
DataGrid
을 WPF의`List '에 바인딩하는 가장 좋은 방법은 무엇입니까?