Hello. How can I store custom object in WPF DataGrid cell? For example, I want to store something like this: http://yfrog.com/0583557380j.
I have no ideas :(. Thanks.
Hello. How can I store custom object in WPF DataGrid cell? For example, I want to store something like this: http://yfrog.com/0583557380j.
I have no ideas :(. Thanks.
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>
HTH,
Kent