Skip to main content

GridSettingsBase.CustomDataActionRouteValues Property

Defines the custom callback routing logic by specifying the names of a Controller and an Action which should handle custom data callbacks initiated by the MVCxClientGridView.GetValuesOnCustomCallback method.

Namespace: DevExpress.Web.Mvc

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

Declaration

public object CustomDataActionRouteValues { get; set; }

Property Value

Type Description
Object

An object containing the Controller and Action names.

Remarks

Use the client MVCxClientGridView.GetValuesOnCustomCallback method if you need to asynchronously go to the server (using AJAX-based callback technology) and perform server-side processing in the specified Action, and then after that, process the returned result in the specified client function without updating (re-rendering) the extension. Via the CustomDataActionRouteValues method’s data parameter, you can pass any information collected on the client to the server, for further server processing.

The client GetValuesOnCustomCallback method posts back to the server using callback technology and is handled in an Action specified by the CustomDataActionRouteValues property. Any data passed via the method’s data parameter can be accessed on the server as a parameter of the specified Action. So, the necessary server-side actions can be performed in the handling Action based upon the value(s) passed from the client.

For instance, you can pass values as a hash table.

Client Script Code:

myGridExtension.GetValuesOnCustomCallback({key1: value}, CallbackHandler);
...
    function CallbackHandler(value) {
        console.log(value);
    }

Controller Code:

//for GridView
ActionResult MyAction(int key1){
    ...
    return GridViewExtension.GetCustomDataCallbackResult("Some data from the server");
}
//for CardView
ActionResult MyAction(int key1){
    ...
    return CardViewExtension.GetCustomDataCallbackResult("Some data from the server");
}

The extension does not automatically update (re-render) itself after such a custom data callback has been sent and processed on the server.

If you need to perform a custom callback to the server that updates the extension, you can send this callback via the MVCxClientGridView.PerformCallback or ASPxClientCardView.PerformCallback method and handle it in an Action specified via the GridSettingsBase.CustomActionRouteValues property.

See Also