Ejemplo n.º 1
0
 protected void ReportPivotGird_CustomCallback(object sender, DevExpress.Web.ASPxPivotGrid.PivotGridCustomCallbackEventArgs e)
 {
     if (LayoutItemsCombo.Value != null)
     {
         var data = LayoutItemsDataSource.Select() as List <PivotLayoutItem>;
         var item = data.Where(i => i.ID == LayoutItemsCombo.Value.ToString().ToInt()).FirstOrDefault();
         if (item != null)
         {
             ReportPivotGird.LoadLayoutFromString(item.Layout);
             ReportPivotGird.DataBind();
         }
     }
 }
Ejemplo n.º 2
0
        protected void LayoutItemsCombo_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            var x = XElement.Parse(e.Parameter);

            switch (x.ValueOf("action"))
            {
            case "save":
            {
                var P      = new ReportPivot();
                var Layout = ReportPivotGird.SaveLayoutToString();

                P.TSP_ReportPivotLayouts(iud: 0, Caption: x.ValueOf("caption"), Layout: ReportPivotGird.SaveLayoutToString());
                if (P.IsError)
                {
                    throw new Exception(Cavea.Core.Properties.Resources.Abort);
                }
                else
                {
                    LayoutItemsDataSource.CacheDuration = 0;
                    LayoutItemsCombo.DataBind();
                    LayoutItemsDataSource.CacheDuration = 3600;
                }
                break;
            }

            case "delete":
            {
                var P = new ReportPivot();
                P.TSP_ReportPivotLayouts(iud: 2, ID: x.IntValueOf("id"));
                if (P.IsError)
                {
                    throw new Exception(Cavea.Core.Properties.Resources.Abort);
                }
                else
                {
                    LayoutItemsDataSource.CacheDuration = 0;
                    LayoutItemsCombo.DataBind();
                    LayoutItemsDataSource.CacheDuration = 3600;
                }

                break;
            }

            case "databind":
            {
                LayoutItemsCombo.DataBind();
                break;
            }
            }
        }