Hi,
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"; budgetingGrid.UnderlyingGrid.Columns.Add(actualsGroup); BoundDataField actualsColumn = CreateAmountColumn(cellKey); actualsColumn.DataFieldName = cellKey; actualsColumn.Header.Text = "Total"; actualsColumn.CssClass = "CenterAlign"; actualsGroup.Columns.Add(actualsColumn); // Add the column to all bands foreach (BudgetingGrid.Band band in budgetingGrid.Bands) { band.UnderlyingBand.Columns.Add(actualsGroup); } } }
Hi pavan,
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:
https://www.infragistics.com/help/aspnet/webhierarchicaldatagrid-outlook-groupby
https://www.infragistics.com/products/aspnet/grids-and-lists/hierarchical-grid
https://www.infragistics.com/samples/aspnet/hierarchical-data-grid/enable-groupby-feature
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.
regards,
Bobby Kulov
Hi Pavan,
You could also check this:
https://www.infragistics.com/help/aspnet/webdatagird-multi-column-headers
Thank you Bobby Kulov, I sorted it out using the above link.
Thanks