ASPxGridViewCustomCallbackEventArgs Class
Namespace: DevExpress.Web
Assembly:
DevExpress.Web.v24.2.dll
Declaration
public class ASPxGridViewCustomCallbackEventArgs :
ASPxGridCustomCallbackEventArgs
Public Class ASPxGridViewCustomCallbackEventArgs
Inherits ASPxGridCustomCallbackEventArgs
The ASPxGridView.CustomCallback event is raised when a round trip to the server has been initiated. This occurs when the client ASPxClientGridView.PerformCallback method is called.
The ASPxGridViewCustomCallbackEventArgs class provides the ASPxGridCustomCallbackEventArgs.Parameters property that specifies a string containing specific information passed from the client side. You can use this property to recognize different kinds of callbacks for performing various actions on the server side.
Example
protected void Grid_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) {
if(e.Parameters == "ApplyCustomFilter")
Grid.FilterExpression = "City = 'Bratislava'";
if(e.Parameters == "ApplyCustomGrouping") {
Grid.DataColumns["City"].GroupBy();
Grid.ExpandAll();
}
}
Protected Sub Grid_CustomCallback(ByVal sender As Object, ByVal e As ASPxGridViewCustomCallbackEventArgs)
If e.Parameters = "ApplyCustomFilter" Then
Grid.FilterExpression = "City = 'Bratislava'"
End If
If e.Parameters = "ApplyCustomGrouping" Then
Grid.DataColumns("City").GroupBy()
Grid.ExpandAll()
End If
End Sub
<script type="text/javascript">
function onApplyFilterButtonClick(s, e) {
grid.PerformCallback("ApplyCustomFilter");
}
function onApplyGroupingButtonClick(s, e) {
grid.PerformCallback("ApplyCustomGrouping");
}
</script>
…
<dx:ASPxGridView ID="Grid" runat="server" KeyFieldName="ID" ClientInstanceName="grid" OnCustomCallback="Grid_CustomCallback">
<Columns>
<dx:GridViewDataColumn FieldName="ID" />
<dx:GridViewDataColumn FieldName="FirstName" />
<dx:GridViewDataColumn FieldName="LastName" />
<dx:GridViewDataColumn FieldName="City" />
</Columns>
</dx:ASPxGridView>
<dx:ASPxButton ID="ApplyFilterButton" runat="server" AutoPostBack="false" UseSubmitBehavior="false" Text="Apply Custom Filter">
<ClientSideEvents Click="onApplyFilterButtonClick" />
</dx:ASPxButton>
<dx:ASPxButton ID="ApplyGroupingButton" runat="server" AutoPostBack="false" UseSubmitBehavior="false" Text="Apply Custom Grouping">
<ClientSideEvents Click="onApplyGroupingButtonClick" />
</dx:ASPxButton>
See Also