Esempio n. 1
0
        protected void ASPxGridView1_CustomCallback1(object sender, ASPxGridViewCustomCallbackEventArgs e)
        {
            try
            {
                switch (e.Parameters)
                {
                case "ExpandAll":
                    ASPxGridView1.ExpandAll();
                    break;

                case "CollapseAll":
                    ASPxGridView1.CollapseAll();
                    break;

                default:
                    var parameters         = e.Parameters.Split(';');
                    var index              = int.Parse(parameters[0]);
                    var isGroupRowSelected = bool.Parse(parameters[1]);
                    for (int i = 0; i < ASPxGridView1.GetChildRowCount(index); i++)
                    {
                        var row = ASPxGridView1.GetChildDataRow(index, i);
                        ASPxGridView1.Selection.SetSelectionByKey(row["INVENTORY"], isGroupRowSelected);
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
 protected void Page_Init(object sender, EventArgs e)
 {
     ASPxGridView1.DataSource = Enumerable.Range(0, 10).Select(i => new { ID = i, Text = i % 2 == 0 ? "Group 1" : "Group 2" });
     if (!IsPostBack)
     {
         ASPxGridView1.DataBind();
     }
     ASPxGridView1.ExpandAll();
 }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ASPxGridView1.DataSource = GridData;
     ASPxGridView1.DataBind();
     if (!IsPostBack)
     {
         ASPxGridView1.ExpandAll();
     }
 }
Esempio n. 4
0
        protected void ASPxButton1_Click(object sender, EventArgs e)
        {
            if (ASPxGridView1.GroupCount == 0)
            {
                ASPxGridViewExporter1.WritePdfToResponse();
            }
            else
            {
                string         groupField  = ASPxGridView1.GetGroupedColumns()[0].FieldName;
                object[]       groupValues = FindGroupValues(ASPxGridView1);
                PrintingSystem ps          = new PrintingSystem();
                Link           clink       = new Link(ps);
                clink.CreateDetailArea += new CreateAreaEventHandler(delegate(object sender2, CreateAreaEventArgs e2)
                {
                    Link self = (Link)sender2;
                    for (int i = 0; i < groupValues.Length; i++)
                    {
                        DevExpress.Web.ASPxGridView.Export.Helper.GridViewLink linkdata = new DevExpress.Web.ASPxGridView.Export.Helper.GridViewLink(ASPxGridViewExporter1);
                        linkdata.PrintingSystemBase = self.PrintingSystem;
                        if (i > 0)
                        {
                            self.PrintingSystem.InsertPageBreak(0);
                        }
                        string filter = ASPxGridView1.FilterExpression;
                        ASPxGridView1.FilterExpression = new GroupOperator(GroupOperatorType.And,
                                                                           CriteriaOperator.Parse(filter), new BinaryOperator(groupField, groupValues[i])).ToString();
                        ASPxGridView1.ExpandAll();
                        ASPxGridViewExporter1.DataBind();

                        BrickModifier skipArea = linkdata.SkipArea;
                        linkdata.SkipArea      = self.SkipArea;
                        linkdata.AddSubreport(System.Drawing.PointF.Empty);
                        linkdata.SkipArea = skipArea;

                        ASPxGridView1.FilterExpression = filter;
                    }
                });

                clink.CreateDocument();
                ps.PageSettings.Landscape = true;
                System.IO.MemoryStream stream = new System.IO.MemoryStream();
                ps.ExportToPdf(stream);
                WriteToResponse("export", true, "pdf", stream);
                stream.Close();
            }
        }
        protected void ASPxGridView1_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
        {
            try
            {
                switch (e.Parameters)
                {
                case "ExpandAll":
                    ASPxGridView1.ExpandAll();
                    break;

                case "CollapseAll":
                    ASPxGridView1.CollapseAll();
                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
Esempio n. 6
0
 protected void ASPxGridView1_DataBound(object sender, EventArgs e)
 {
     ASPxGridView1.ExpandAll();
 }