0
我有ItemsSource
被綁定到LINQ到實體查詢的結果,並且在一個列中的數據網格是EntityCollection
對象。如何在C#中爲DataGrid中的單元格設置模板?
private void DataGridRecipientsLoad()
{
dataGridRecipients.ItemsSource = from rec in _recipientService.GetAllRecipients()
select rec;
dataGridRecipients.Columns[7].Visibility = System.Windows.Visibility.Collapsed;
dataGridRecipients.Columns[8].Visibility = System.Windows.Visibility.Collapsed;
}
如何創建在C#中的模板取出剛剛字符串屬性出的物品中Entity Collection
並顯示它們?現在細胞是空的。
EntityCollection
包含實體,稱爲MailingList
,我想顯示它們每個的myMailingList.Name
。