GridViewExtension.SetEditErrorText(String) Method

Displays the specified (error) text in a special row at the bottom of the grid's Edit Form.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v19.2.dll

Declaration

public GridViewExtension SetEditErrorText(
    string message
)
Public Function SetEditErrorText(
    message As String
) As GridViewExtension

Parameters

Name Type Description
message String

A string value specifying the text to be displayed within the Edit Form's bottom.

Returns

Type Description
GridViewExtension

A GridViewExtension object representing the GridView extension.

Remarks

If Model data is invalid or an error occurs during data changes, you can use the grid's SetEditErrorText method to display a common error text in a special row at the bottom of the grid's edit form.

This method can be used together with the automatic Model error visualization feature controlled by the grid's MVCxGridViewEditingSettings.ShowModelErrorsForEditors property.

To learn more, see our online demo: Grid View - Edit Modes

Note

When GridView functions in the batch edit mode, the SetEditErrorText method doesn't work. To show edit errors in batch edit mode, use the MVCxBatchUpdateValues<T, S>.SetErrorText method. Refer to the Batch Editing topic to learn more.

Example

@{
    var grid = Html.DevExpress().GridView(settings => {
        settings.Name = "gvEditing";
        settings.KeyFieldName = "ProductID";
    ...
    if (ViewData["EditError"] != null){
        grid.SetEditErrorText((string)ViewData["EditError"]);
    }
}

@grid.Bind(Model).GetHtml()

Online Demos

See Also