protected void ASPxPivotGrid1_DataBound(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ASPxPivotGrid1.CollapseAll();
     }
 }
        protected void ASPxComboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            ASPxPivotGrid1.BeginUpdate();
            switch (SelectedDemo)
            {
            case 0:
                ASPxPivotGrid1.Fields[0].Visible       = true;
                ASPxPivotGrid1.Fields[0].Caption       = "Product Group";
                ASPxPivotGrid1.Fields[0].GroupInterval = DevExpress.XtraPivotGrid.PivotGroupInterval.Custom;
                ASPxPivotGrid1.Fields[0].AreaIndex     = 0;
                ASPxPivotGrid1.Fields[4].Caption       = "Year";
                ASPxPivotGrid1.Fields[4].FilterValues.Clear();
                ASPxPivotGrid1.Fields[4].GroupInterval = DevExpress.XtraPivotGrid.PivotGroupInterval.DateYear;
                ASPxPivotGrid1.Fields[3].Visible       = false;
                ASPxPivotGrid1.Fields[3].GroupInterval = PivotGroupInterval.Default;
                break;

            case 1:
                ASPxPivotGrid1.Fields[3].Visible       = true;
                ASPxPivotGrid1.Fields[3].Caption       = "Year - Quarter";
                ASPxPivotGrid1.Fields[3].GroupInterval = DevExpress.XtraPivotGrid.PivotGroupInterval.Custom;
                ASPxPivotGrid1.Fields[3].AreaIndex     = 0;
                ASPxPivotGrid1.Fields[4].Caption       = "Shipped Date";
                ASPxPivotGrid1.Fields[4].FilterValues.Clear();
                ASPxPivotGrid1.Fields[4].GroupInterval = DevExpress.XtraPivotGrid.PivotGroupInterval.Default;
                ASPxPivotGrid1.Fields[4].AreaIndex     = 1;
                ASPxPivotGrid1.Fields[0].Visible       = false;
                ASPxPivotGrid1.Fields[0].GroupInterval = PivotGroupInterval.Default;
                break;
            }
            ASPxPivotGrid1.EndUpdate();
            ASPxPivotGrid1.CollapseAll();
        }