aspxpivotgrid排序
protected virtual void SetSortBySummary() { foreach (PivotGridField field in grid.Fields) { if (field.Area == DevExpress.XtraPivotGrid.PivotArea.DataArea) { field.CellStyle.Font.Bold = false; field.HeaderStyle.Font.Bold = false; } } PivotGridField selectedField = grid.Fields[ddlSortByField.SelectedItem.Text]; if (selectedField == null) return; selectedField.CellStyle.Font.Bold = true; selectedField.HeaderStyle.Font.Bold = true; //改变row的field之后改变sort的值 try { sort = grid.GetFieldsByArea(DevExpress.XtraPivotGrid.PivotArea.RowArea)[0].ToString(); } catch { } grid.Fields[sort].SortBySummaryInfo.FieldName = selectedField.FieldName; grid.Fields[sort].SortBySummaryInfo.SummaryType = selectedField.SummaryType; }
年轻过得闲,以后被人嫌...
年轻累不死....