PivotGridCallbackStateEventArgs.CallbackState Property

Gets or sets the ASPxPivotGrid’s callback state.

Namespace: DevExpress.Web.ASPxPivotGrid

Assembly: DevExpress.Web.ASPxPivotGrid.v21.1.dll

Declaration

public string CallbackState { get; set; }

Property Value

Type Description
String

A string value specifying the pivot grid’s callback state.

Example

This example demonstrates how the ASPxPivotGrid.CustomSaveCallbackState and ASPxPivotGrid.CustomLoadCallbackState events can be handled to preserve the ASPxPivotGrid’s callback state within a Session.

View Example

using System;
using DevExpress.Web.ASPxPivotGrid;

public partial class _Default : System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {

    }
    string GetPivotStateID(ASPxPivotGrid pivotGrid) {
        return GetType().FullName + "_" + pivotGrid.ID;
    }
    protected void ASPxPivotGrid1_CustomSaveCallbackState(object sender, 
                                  PivotGridCallbackStateEventArgs e) {
        Session[GetPivotStateID((ASPxPivotGrid)sender)] = e.CallbackState;
        e.CallbackState = null;
        e.Handled = true;
    }
    protected void ASPxPivotGrid1_CustomLoadCallbackState(object sender, 
                                  PivotGridCallbackStateEventArgs e) {
        e.CallbackState = (string)Session[GetPivotStateID((ASPxPivotGrid)sender)];
        e.Handled = true;
    }
}
See Also