Back to Devexpress

CRXPF0008 - In-place editing is not available when NavigationStyle is set to Row or None

coderushforroslyn-403956-static-code-analysis-xaml-analyzers-crxpf-0008-editing-is-not-available-when-navigation-style-is-set-to-row-or-none.md

latest3.0 KB
Original Source

CRXPF0008 - In-place editing is not available when NavigationStyle is set to Row or None

  • Feb 14, 2023
  • 2 minutes to read

Severity: Warning

The analyzer detects that you set the ColumnBase.AllowEditing or DataViewBase.AllowEditing property to true , and the DataViewBase.NavigationStyle property is not set to Cell. In this case, users cannot use in-place data editors to edit cell values. If the DataViewBase.NavigationStyle property is set to Row , you can still allow users to edit data in the Edit Form.

Examples

Invalid Code

xaml
<dxg:GridControl ...>
    <dxg:GridControl.View>
        <!-- A DevExpress.Xpf.Grid.DataViewBase descendant: -->
        <dxg:TableView NavigationStyle="Row" .../>
        <!-- OR -->
        <dxg:TableView NavigationStyle="None" .../>
    </dxg:GridControl.View>
    <dxg:GridColumn FieldName="Name" AllowEditing="True"/>
    <!-- ... -->
</dxg:GridControl>

Valid Code

xaml
<dxg:GridControl ...>
    <dxg:GridControl.View>
        <!-- A DevExpress.Xpf.Grid.DataViewBase descendant: -->
        <dxg:TableView NavigationStyle="Cell" .../>
        <!-- OR -->
        <dxg:TableView .../>
    </dxg:GridControl.View>
    <dxg:GridColumn FieldName="Name" AllowEditing="True"/>
    <!-- ... -->
</dxg:GridControl>

<!-- OR -->

<dxg:GridControl ...>
    <dxg:GridControl.View>
        <!-- A DevExpress.Xpf.Grid.DataViewBase descendant: -->
        <dxg:TableView NavigationStyle="Row" EditFormShowMode="Inline" .../>
    </dxg:GridControl.View>
    <dxg:GridColumn FieldName="Name" AllowEditing="True"/>
    <!-- ... -->
</dxg:GridControl>

How to Fix

Refer to the following help topic for more information: Data Editing and Validation.