【发布时间】:2012-11-19 12:57:04
【问题描述】:
这似乎有点微不足道,但我的 WPF 应用程序中有一个 XamDataGrid,我想自己设置它的列标题,但不能。
绑定到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>
谢谢。
【问题讨论】:
-
Field 上没有 Label 属性可以为列标题设置自定义文本吗?
-
有,但不会覆盖绑定类的属性名称。
标签: wpf infragistics xamdatagrid