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

MVCxGridViewEditingSettings.DeleteRowRouteValues Property

Defines the callback routing logic by specifying the names of a Controller and an Action which should handle callbacks related to row deleting.

Namespace: DevExpress.Web.Mvc

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

Declaration

public object DeleteRowRouteValues { get; set; }

Property Value

Type Description
Object

An object containing the Controller and Action names.

Property Paths

You can access this nested property as listed below:

Object Type Path to DeleteRowRouteValues
GridViewSettings
.SettingsEditing.DeleteRowRouteValues
GridViewSettings<RowType>
.SettingsEditing.DeleteRowRouteValues
MVCxGridView
.SettingsEditing.DeleteRowRouteValues
MVCxGridViewProperties
.SettingsEditing.DeleteRowRouteValues

Remarks

If row deletion is allowed for GridView, you should provide an associated controller action that will apply delete operations to a Model and return the grid’s partial view. Use the DeleteRowRouteValues property to reference this controller action by its name and the name of its controller.

Note that in an action that handles update operations, you can obtain the edited object using our specific DevExpressEditorsBinder model binder.

View (InlineEditingPartial):


var grid = Html.DevExpress().GridView(
        settings =>
        {
            settings.Name = "gvEditing";
            settings.KeyFieldName = "ProductID";
            settings.CallbackRouteValues = new { Controller = "GridView", Action = "InlineEditingPartial" };
            ...
            settings.SettingsEditing.DeleteRowRouteValues = new { Controller = "GridView", Action = "InlineEditingDeletePartial" };
            ...
    grid.Bind(Model).Render();

Controller (‘GridViewController’):


public partial class GridViewController : Controller {
        ...
        public ActionResult InlineEditingPartial() {
            return PartialView("InlineEditingPartial", NorthwindDataProvider.GetEditableProducts());
        }
        ...
        [HttpPost]
        public ActionResult InlineEditingDeletePartial(int productID) {
            if(productID > 0) {
                try {
                    NorthwindDataProvider.DeleteProduct(productID);
                }
                catch(Exception e) {
                    ViewData["EditError"] = e.Message;
                }
            }
            return PartialView("InlineEditingPartial", NorthwindDataProvider.GetEditableProducts());
        }
        ...

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DeleteRowRouteValues property.

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