A control can update only its own rendering in a callback. This example shows how to update the ASPxLabel control when a callback of the ASPxGridView control is finished.
ASPxGridView sends callbacks to update row data on the server. The control raises the EndCallback client event after a callback is successfully executed. You can handle the event to perform custom actions with another control when the callback is finished.
<dx:ASPxGridView ...>
<ClientSideEvents EndCallback="OnEndCallBack" />
</dx:ASPxGridView>
ASPxGridView implements the JSProperties property that allows you to pass information from the server to the client. In this example, an updated row’s key is saved to the JSProperties property on the server. This value is then used on the client to display information about the updated row.
protected void Page_Load(object sender, EventArgs e) {
ASPxGridView1.JSProperties["cpIsUpdated"] = "";
}
protected void ASPxGridView1_RowUpdated(object sender, DevExpress.Web.Data.ASPxDataUpdatedEventArgs e) {
if (e.Exception == null) {
((ASPxGridView)sender).JSProperties["cpIsUpdated"] = e.Keys[0];
}
}
function OnEndCallBack(s, e) {
if (s.cpIsUpdated != '') {
clientLabel.SetText('Category ' + s.cpIsUpdated + ' is updated successfully');
}
else {
clientLabel.SetText('');
}
}
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)