Back to Devexpress

CRXPF0003 - FieldName is equal to the Binding path

coderushforroslyn-403947-static-code-analysis-xaml-analyzers-crxpf-0003-field-name-is-equal-to-the-binding-path.md

latest1.7 KB
Original Source

CRXPF0003 - FieldName is equal to the Binding path

  • Feb 14, 2023

Severity: Warning

The analyzer detects that you specify the ColumnBase.Binding and ColumnBase.FieldName properties for the same column and warns you that, in this case, the ColumnBase.FieldName property should not be assigned to an existing property name.

Examples

Invalid Code

xaml
<dxg:GridColumn FieldName="Name" Binding="{Binding Name, ...}"/>
<!-- OR -->
<dxg:GridColumn FieldName="Name" Binding="{Binding Data.Name, ...}"/>
<!-- OR -->
<dxg:GridColumn FieldName="Name" Binding="{Binding RowData.Row.Name, ...}"/>

Valid Code

xaml
<dxg:GridColumn FieldName="Name"/>
<!-- OR -->
<dxg:GridColumn Binding="{Binding Name, ...}"/>
<!-- OR -->
<dxg:GridColumn FieldName="NonExistingName" Binding="{Binding Name, ...}"/>

How to Fix

Refer to the following help topic for more information: Binding Columns to Data Source Fields.