Back to Devexpress

ASPxGridCustomCallbackEventArgs.Parameters Property

aspnet-devexpress-dot-web-dot-aspxgridcustomcallbackeventargs.md

latest7.9 KB
Original Source

ASPxGridCustomCallbackEventArgs.Parameters Property

Gets a string that contains specific information (if any) passed from the client side.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public string Parameters { get; }
vb
Public ReadOnly Property Parameters As String

Property Value

TypeDescription
String

A string value that contains specific information collected on the client side and passed to the event for further server-side processing.

|

Remarks

Use the Parameters property to obtain specific information that has been collected on the client side and passed by the client PerformCallback method to the server for further server-side processing.

You can use the Parameters property to recognize different kinds of callbacks to perform different actions on the server side.

Example

csharp
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();
     }
}
vb
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
aspx
<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>

The following code snippets (auto-collected from DevExpress Examples) contain references to the Parameters property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-web-forms-create-responsive-web-app/CS/ResponsiveWebApplication/GridView.aspx.cs#L16

csharp
protected void GridView_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) {
    if(e.Parameters == "delete") {
        List<long> selectedIds = GridView.GetSelectedFieldValues("Id").ConvertAll(id => (long)id);

asp-net-web-forms-grid-switch-data-sources-at-runtime/CS/Solution/Default.aspx.cs#L23

csharp
protected void grid_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) {
    Session["selectedDataSource"] = Int32.Parse(e.Parameters);

asp-net-web-forms-grid-created-at-runtime-switch-data-sources/CS/Solution/Default.aspx.cs#L23

csharp
protected void grid_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) {
    Session["selectedDataSource"] = Int32.Parse(e.Parameters);

web-forms-pivot-grid-obtain-underlying-data/CS/ASPxPivotGrid_DisplayUnderlyingRecords/Default.aspx.cs#L18

csharp
ASPxGridViewCustomCallbackEventArgs e) {
if (e.Parameters == "D")
{

asp-net-web-forms-grid-move-selected-rows-between-grid-controls/VB/E2636/Default.aspx.vb#L24

vb
Select Case e.Parameters
    Case "addSelectedRows"

asp-net-web-forms-grid-switch-data-sources-at-runtime/VB/Solution/Default.aspx.vb#L26

vb
Protected Sub grid_CustomCallback(ByVal sender As Object, ByVal e As ASPxGridViewCustomCallbackEventArgs)
    Session("selectedDataSource") = Int32.Parse(e.Parameters)

asp-net-web-forms-grid-created-at-runtime-switch-data-sources/VB/Solution/Default.aspx.vb#L26

vb
Protected Sub grid_CustomCallback(ByVal sender As Object, ByVal e As ASPxGridViewCustomCallbackEventArgs)
    Session("selectedDataSource") = Integer.Parse(e.Parameters)
    Dim grid As ASPxGridView = TryCast(sender, ASPxGridView)

web-forms-pivot-grid-obtain-underlying-data/VB/ASPxPivotGrid_DisplayUnderlyingRecords/Default.aspx.vb#L18

vb
Protected Sub ASPxGridView1_CustomCallback(ByVal sender As Object, ByVal e As ASPxGridViewCustomCallbackEventArgs)
    If Equals(e.Parameters, "D") Then
        ASPxGridView1.PageIndex = 0

See Also

js-ASPxClientCardView.PerformCallback

js-ASPxClientGridView.PerformCallback

js-ASPxClientVerticalGrid.PerformCallback

Code Central example E4521

ASPxGridCustomCallbackEventArgs Class

ASPxGridCustomCallbackEventArgs Members

DevExpress.Web Namespace