protected void Page_Load(object sender, EventArgs e) { gridCustomers.GroupSummarySortInfo.Clear(); ASPxGroupSummarySortInfo sortInfo = new ASPxGroupSummarySortInfo(); sortInfo.SortOrder = ColumnSortOrder.Ascending; sortInfo.SummaryItem = gridCustomers.GroupSummary["Country", SummaryItemType.Custom]; sortInfo.GroupColumn = "City"; gridCustomers.GroupSummarySortInfo.AddRange(sortInfo); }
protected void ASPxGridView1_Init(object sender, EventArgs e) { var grid = sender as ASPxGridView; grid.DataSource = Enumerable.Range(0, 5).Select(i => new { ProductName = i % 2 == 0 ? "Product One" : "Product Two", OrderID = i, Units = i * 100 }); grid.DataBind(); var sortInfo = new ASPxGroupSummarySortInfo(); sortInfo.SortOrder = GetStateSortOrder(); sortInfo.SummaryItem = ASPxGridView1.GroupSummary["Units", SummaryItemType.Sum]; sortInfo.GroupColumn = "ProductName"; grid.GroupSummarySortInfo.AddRange(sortInfo); }
public void FillGroupsGrid() { DataTable dt = VSWebBL.DashboardBL.Office365BL.Ins.Groupgrid(); if (dt.Rows.Count > 0) { Office365Groupsgrid.DataSource = dt; Session["Office365Groupsgrid"] = dt; Office365Groupsgrid.DataBind(); Office365Groupsgrid.GroupSummarySortInfo.Clear(); ((GridViewDataColumn)Office365Groupsgrid.Columns["GroupName"]).GroupBy(); ASPxGroupSummarySortInfo sortInfo = new ASPxGroupSummarySortInfo(); sortInfo.SortOrder = DevExpress.Data.ColumnSortOrder.Ascending; sortInfo.SummaryItem = Office365Groupsgrid.GroupSummary["GroupName", DevExpress.Data.SummaryItemType.Count]; sortInfo.GroupColumn = "GroupName"; Office365Groupsgrid.GroupSummarySortInfo.AddRange(sortInfo); } }