ASPxGridView.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.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Event Data
The AfterPerformCallback event's data class is ASPxGridViewAfterPerformCallbackEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Args | Gets specific information (if any) passed from the client side. Inherited from ASPxGridAfterPerformCallbackEventArgs. |
CallbackName | Gets 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., ‘EXPANDROW’, SORT’, ‘COLUMNMOVE’, etc.).
Example
This sample illustrates one more way to get and set editors values using the AfterPerformCallback
event handler.
<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="AccessDataSource1" KeyFieldName="CategoryID" OnAfterPerformCallback="ASPxGridView1_AfterPerformCallback" OnRowUpdating="ASPxGridView1_RowUpdating">
<Columns>
<dx:GridViewCommandColumn ShowEditButton="True" />
<dx:GridViewDataTextColumn FieldName="CategoryID" />
<dx:GridViewDataTextColumn FieldName="CategoryName" />
<dx:GridViewDataTextColumn FieldName="Description" />
</Columns>
<Templates>
<EditForm>
<table>
<tr>
<td>CategoryID:</td>
<td>
<dx:ASPxLabel ID="ASPxLabel1" runat="server" Text='<%#Eval("CategoryID") %>'>
</dx:ASPxLabel>
</td>
</tr>
<tr>
<td>CategoryName:</td>
<td>
<dx:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="170px" Text='<%#Bind("CategoryName") %>'>
</dx:ASPxTextBox>
</td>
</tr>
<tr>
<td>Description:</td>
<td>
<dx:ASPxTextBox ID="ASPxTextBox2" runat="server" Width="170px" BackColor="LemonChiffon">
</dx:ASPxTextBox>
</td>
</tr>
<tr>
<td></td>
<td style="font-size: x-small">*yellow is unbound</td>
</tr>
</table>
<dx:ASPxGridViewTemplateReplacement ReplacementType="EditFormUpdateButton" ID="Upd" runat="server" />
<dx:ASPxGridViewTemplateReplacement ReplacementType="EditFormCancelButton" ID="Cancel" runat="server" />
</EditForm>
</Templates>
</dx:ASPxGridView>
protected void ASPxGridView1_AfterPerformCallback(object sender, DevExpress.Web.ASPxGridViewAfterPerformCallbackEventArgs e) {
if (e.CallbackName == "STARTEDIT") {
int index = ((ASPxGridView)sender).EditingRowVisibleIndex;
string val = ((ASPxGridView)sender).GetRowValues(index, "Description").ToString();
ASPxTextBox box = ((ASPxGridView)sender).FindEditFormTemplateControl("ASPxTextBox2") as ASPxTextBox;
box.Text = val;
}
}
protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) {
ASPxTextBox box = ((ASPxGridView)sender).FindEditFormTemplateControl("ASPxTextBox2") as ASPxTextBox;
e.NewValues["Description"] = box.Text;
}