I'm trying to group 2 columns under one group and below is the code I'm using to achieve that. Somehow I'm not able to see the Groupfields in the markup. Any help is greatly appreciated.
private void AddActualsColumns(BudgetingGrid budgetingGrid)
for (int year = budgetingGrid.FirstYearToDisplay; year < budgetingGrid.BudgetingYear; year++)
string cellKey = year + "Total1";
GroupField actualsGroup = new GroupField();
actualsGroup.Header.Text = year.ToString();
actualsGroup.Key = cellKey + "Group";
BoundDataField actualsColumn = CreateAmountColumn(cellKey);
actualsColumn.DataFieldName = cellKey;
actualsColumn.Header.Text = "Total";
actualsColumn.CssClass = "CenterAlign";
// Add the column to all bands
foreach (BudgetingGrid.Band band in budgetingGrid.Bands)
I'm not sure what your trying to do. I suppose you're trying to 'Group By' two columns. Is that correct? If so you could check the following resources:
If that's not the case could please provide us more detailed information: what exactly you're trying to achieve; is the solution you provided in your first post working from the code behind but not working from markup, etc.
You could also check this: