【发布时间】:2016-07-22 15:11:13
【问题描述】:
我有一个字符串字典,我想将它绑定到 WPF 中的 DataGrid。
<DataTemplate DataType="{x:Type DictionaryClass}">
<DataGrid HorizontalAlignment="Stretch"
ItemsSource="{Binding StringDictionary}">
</DataGrid>
</DataTemplate>
这会按预期创建两列,但是这两列分别具有标题“Key”和“Value”。我知道我可以更改HeadersVisibility 属性,如何设置我自己的自定义列标题?
【问题讨论】:
标签: c# wpf dictionary datagrid