Back to Devexpress

ASPxCardView.AfterPerformCallback Event

aspnet-devexpress-dot-web-dot-aspxcardview-3f60f871.md

latest4.5 KB
Original Source

ASPxCardView.AfterPerformCallback Event

Fires after a callback or a postback initiated by the control has been processed on the server.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public event ASPxCardViewAfterPerformCallbackEventHandler AfterPerformCallback
vb
Public Event AfterPerformCallback As ASPxCardViewAfterPerformCallbackEventHandler

Event Data

The AfterPerformCallback event's data class is ASPxCardViewAfterPerformCallbackEventArgs. The following properties provide information specific to this event:

PropertyDescription
ArgsGets specific information (if any) passed from the client side. Inherited from ASPxGridAfterPerformCallbackEventArgs.
CallbackNameGets the callback name. Inherited from ASPxGridAfterPerformCallbackEventArgs.

Remarks

Handle the AfterPerformCallback event to perform actions after a callback or a postback initiated by the control has been processed on the server. Use the ASPxGridAfterPerformCallbackEventArgs.CallbackName property to identify the processed callback (e.g., ‘STARTEDIT’, CUSTOMCALLBACK’, etc.).

Example

This example illustrates how to handle the AfterPerformCallback event to perform simple actions depending on the callback type.

aspx
<dx:ASPxCardView ID="ASPxCardView1" runat="server" ClientInstanceName="cardview" 
                 DataSourceID="AccessDataSource1" OnAfterPerformCallback="ASPxCardView1_AfterPerformCallback" 
                 KeyFieldName="CustomerID" AutoGenerateColumns="False">
    <Columns>
        <dx:CardViewTextColumn FieldName="CompanyName" />
        <dx:CardViewTextColumn FieldName="ContactName" />
        <dx:CardViewTextColumn FieldName="City" />
        <dx:CardViewTextColumn FieldName="Region" />
        <dx:CardViewTextColumn FieldName="Country" />
    </Columns>
    <CardLayoutProperties>
        <Items>
            <dx:CardViewCommandLayoutItem HorizontalAlign="Right" 
                ShowSelectCheckbox="True" ShowEditButton="True" />
            <dx:CardViewColumnLayoutItem ColumnName="Company Name" />
            <dx:CardViewColumnLayoutItem ColumnName="Contact Name" />
            <dx:CardViewColumnLayoutItem ColumnName="City" />
            <dx:CardViewColumnLayoutItem ColumnName="Region" />
            <dx:CardViewColumnLayoutItem ColumnName="Country" />
            <dx:EditModeCommandLayoutItem HorizontalAlign="Right" />
        </Items>
    </CardLayoutProperties>
</dx:ASPxCardView>

<dx:ASPxButton ID="ASPxButton1" AutoPostBack="False" runat="server" Text="Custom Callback">
    <ClientSideEvents Click="function(s, e) {
        cardview.PerformCallback(); 
    }" />
</dx:ASPxButton>
csharp
protected void ASPxCardView1_AfterPerformCallback(object sender, ASPxCardViewAfterPerformCallbackEventArgs e) {
    if (e.CallbackName == "STARTEDIT") {
        ASPxCardView1.Columns[0].ReadOnly = true;
    }
    if (e.CallbackName == "CUSTOMCALLBACK") {
        ASPxCardView1.Selection.UnselectAll();
    }
}
vb
Protected Sub ASPxCardView1_AfterPerformCallback(ByVal sender As Object, ByVal e As ASPxCardViewAfterPerformCallbackEventArgs)
    If e.CallbackName = "STARTEDIT" Then
        ASPxCardView1.Columns(0).ReadOnly = True
    End If

    If e.CallbackName = "CUSTOMCALLBACK" Then
        ASPxCardView1.Selection.UnselectAll()
    End If
End Sub

See Also

Card View

ASPxCardView Class

ASPxCardView Members

DevExpress.Web Namespace