Back to Devexpress

ASPxClientBeginCallbackEventArgs Class

aspnet-js-aspxclientbegincallbackeventargs-d2eea904.md

latest1.8 KB
Original Source

ASPxClientBeginCallbackEventArgs Class

Provides data for client events related to the beginning of a callback processing round trip.

Declaration

ts
declare class ASPxClientBeginCallbackEventArgs extends ASPxClientEventArgs

Remarks

Objects of the ASPxClientBeginCallbackEventArgs type are used as arguments for the BeginCallback events generated on the client side.

ASPxClientBeginCallbackEventArgs objects with proper settings are automatically created and passed to the corresponding event handlers.

Example

The following example illustrates how to use the command property.

Web Forms:

aspx
<dx:ASPxGridView runat="server" ID="ASPxGridView1" ... >
<ClientSideEvents EndCallback="OnEndCallback" BeginCallback="OnBeginCallback"/> 
...
</dx:ASPxGridView>
javascript
var command = "";
function OnBeginCallback(s, e) {
    command = e.command;
}
function OnEndCallback(s, e) {
    if (command == "ADDNEWROW") {
        s.Refresh();
    }
}

MVC:

cshtml
@Html.DevExpress().GridView(settings => {
    settings.Name = "GridView1";
    settings.KeyFieldName = "ID";

    settings.ClientSideEvents.BeginCallback = "function(s, e) { command = e.command; }";
    settings.ClientSideEvents.EndCallback = "function(s, e) { if (command == 'ADDNEWROW') {
        s.Refresh(); } }";
}).Bind(Model).GetHtml()

Inheritance

ASPxClientEventArgs ASPxClientBeginCallbackEventArgs ASPxClientGlobalBeginCallbackEventArgs

See Also

ASPxClientBeginCallbackEventArgs Members