Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
425
Unable to see groupfileds in the markup for WebHierarchicalDataGrid control
posted

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);
                }
            }
        }