This example demonstrates how to use the callback functionality to update the master grid when detail grid data changes.
Handle the detail grid's client-side BeginCallback and EndCallback events to refresh the master grid control when a callback is finished. Use the command
argument property to determine the action that initiates that callback.
<dx:ASPxGridView ID="ASPxGridView1" runat="server" KeyFieldName="Id" ... >
<SettingsDetail ShowDetailRow="true" />
<!-- ... -->
<Templates>
<DetailRow>
<dx:ASPxGridView ID="gridProducts" runat="server" KeyFieldName="Id" ... >
<ClientSideEvents EndCallback="OnEndCallback" BeginCallback="OnBeginCallback" />
<!-- ... -->
</dx:ASPxGridView>
</DetailRow>
</Templates>
</dx:ASPxGridView>
var command = "";
function OnBeginCallback(s, e) {
command = e.command;
}
function OnEndCallback(s, e) {
if (command == "ADDNEWROW") {
s.Refresh();
}
}
- OrderItems.cs (VB: OrderItems.vb)
- Default.aspx (VB: Default.aspx)
(you will be redirected to DevExpress.com to submit your response)