Skip to main content
A newer version of this page is available. .

GridCellValidationEventArgs Class

Provides data for the GridColumn.Validate event.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v17.2.dll

Declaration

public class GridCellValidationEventArgs :
    GridRowValidationEventArgs,
    IDataCellEventArgs

Remarks

To learn more, see Cell Validation.

Example

This example shows how to validate the focused cell's value. In this example, the product's price can be reduced by 30% if the product is discontinued.

<Window x:Class="DXGrid_ValidatingEditors.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" 
        Title="Window1" Height="300" Width="600">
    <Grid>
        <dxg:GridControl x:Name="grid" ItemsSource="{Binding ProductList}">
            <dxg:GridControl.Columns>
                <dxg:GridColumn FieldName="ProductName">
                    <dxg:GridColumn.EditSettings>
                        <dxe:TextEditSettings AllowNullInput="False" />
                    </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>
                <dxg:GridColumn FieldName="UnitPrice" Validate="GridColumn_Validate">
                    <dxg:GridColumn.EditSettings>
                        <dxe:SpinEditSettings DisplayFormat="c2" />
                    </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>
                <dxg:GridColumn FieldName="Discontinued" />
            </dxg:GridControl.Columns>
            <dxg:GridControl.View>
                <dxg:TableView AutoWidth="True" HiddenEditor="TableView_HiddenEditor" />
            </dxg:GridControl.View>
        </dxg:GridControl>
    </Grid>
</Window>

The following code snippets (auto-collected from DevExpress Examples) contain references to the GridCellValidationEventArgs class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also