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.v24.2.dll
NuGet Package: DevExpress.Web.Mvc5
#Declaration
public GridViewExtension SetEditErrorText(
string message
)
#Parameters
Name | Type | Description |
---|---|---|
message | String | A string value specifying the text to be displayed within the Edit Form’s bottom. |
#Returns
Type | Description |
---|---|
Grid |
A Grid |
#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 Grid
#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()