开发者

How can I store custom object in WPF DataGrid cell?

开发者 https://www.devze.com 2023-01-13 15:51 出处:网络
How ca开发者_如何学运维n I store custom object in WPF DataGrid cell? Use a DataGridTemplateColumn:

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消