How ca开发者_如何学运维n I store custom object in WPF DataGrid cell?
Use a DataGridTemplateColumn
:
<DataGrid ItemsSource="{Binding}" AutoGenerateColumns="False" >
<DataGrid.Columns>
<DataGridTemplateColumn Header="Custom Column">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<!-- whatever you like in here -->
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridtemplateColumn>
</DataGrid.Columns>
</DataGrid>
精彩评论