这似乎有点微不足道,但我XamDataGrid在我的 WPF 应用程序中有一个我想自己设置它的列标题但不能。
绑定是到BindingList<DictionaryEntry>(不是那个.Net,但仍然只有Key和Value属性。
这些列被命名Key并且Value(如果我更改DictionaryEntry类中的属性名称,则更新),而我想在 XAML 中设置它们:(该FieldsLayout部分)
<igDP:XamDataGrid Grid.Row="1"
Grid.Column="0"
Name="ResultStructure"
DataSource="{Binding Path=VariablesDictionary, Mode=TwoWay, ValidatesOnExceptions=True}"
Theme="Aero"
GroupByAreaLocation="None"
IsEnabled="{Binding CanEditStructure}"
CellUpdating="ResultStructure_OnCellUpdating"
CellUpdated="ResultStructure_OnCellUpdated">
<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings AllowClipboardOperations="All"
AllowFieldMoving="WithinLogicalRow"
AllowAddNew="True"
AddNewRecordLocation="OnBottom"
AllowDelete="True" />
</igDP:XamDataGrid.FieldLayoutSettings>
<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout>
<igDP:FieldLayout.Fields>
<igDP:Field Name="Column" Tag="Column" Width="Auto" />
<igDP:Field Tag="Variable" Name="Variable" Width="Auto" />
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>
谢谢。