GroupAggregate and C1GroupTextEventArgs for C1GridView 2025v2 399

Posted by: enrique.pv-ext on 9 January 2026, 7:33 am EST

    • Post Options:
    • Link

    Posted 9 January 2026, 7:33 am EST

    Hi,

    Migrate from 2010v1 to 2025v2 399 in ASP.NET WebForms NET Framework 4.8.1.

    Using C1GridView from C1.Web.Wijmo.Controls.48.dll

    Error about OnGroupAggregate=“CashBreakDownGrid_GroupAggregate” and C1GroupTextEventArgs class.

    My markup code:

        <cc1:C1GridView ID="CashBreakDownGrid" runat="server" 
            AutoGenerateColumns="False"                 
            UseEmbeddedVisualStyles = "false"
            VisualStylePath="~/VisualStyles" 
            VisualStyle="Vista"
            DataKeyNames="ID, VALUE, TIMESTAMP"
            OnGroupAggregate="CashBreakDownGrid_GroupAggregate"
            Width="100%" 
            OnRowDataBound="CashBreakDownGrid_RowDataBound" 
            EmptyDataText="No hay datos"
            ClientIDMode="AutoID" >
            <Columns>

    My code server backend, using Group AGgreate for Calculates de total sum and binds it to the grid.

    C1GroupTextEventArgs not exixts.

      protected void CashBreakDownGrid_GroupAggregate(object sender, C1GroupTextEventArgs e)
      {
          Thread.CurrentThread.CurrentCulture = Util.GetCulture();
          decimal sum = 0;
          for (int i = e.StartItemIndex; i <= e.EndItemIndex; i++)
          {
              string s = ((Label)((C1GridView)sender).Rows[i].Cells[0].FindControl("lblAmount")).Text;
              decimal val;
              decimal.TryParse(s, System.Globalization.NumberStyles.Any, null, out val);
              sum += val;
          }
    
          string currencySymbol = "<span style='max-width:85px;display:inline-block;overflow:hidden'>" + Util.GetCulture().NumberFormat.CurrencySymbol + "</span>&nbsp;";
          e.Text = currencySymbol + "<span style='max-width:85px;display:inline-block;overflow:hidden' id=\"" + this.ClientID + "_CashBreakDownGridTotal\">" + string.Format("{0:N}", sum) + "</span>";
    
          txtCashBreakDownTotal.Text = sum.ToString("N", new CultureInfo("en-US"));
      }

    Any suggestions about GroupAggreate ?

  • Posted 12 January 2026, 8:11 am EST

    Hi,

    You can explore ‘OnClientGroupAggregate’ function in the C1GridView API for this purpose: https://developer.mescius.com/componentone/docs/webforms/online-gridview/C1.Web.Wijmo.Controls.45~C1.Web.Wijmo.Controls.C1GridView.C1GridView~OnClientGroupAggregate.html

    In case you still have doubts, then please share a small sample application that shows the issue.

    Please note that ASP.NET WebForms is now considered a legacy platform, and there is no active development ongoing for it. Additionally, you are upgrading from a very old version, which typically requires reimplementing several features from scratch.

    Therefore, we strongly recommend considering a migration to ASP.NET MVC to take advantage of the latest features, improvements, and full product support.

    You can refer to the following documentation for more details:

    https://developer.mescius.com/componentone/docs/mvc/online-mvc/overview

    Thanks for your understanding.

    Kind Regards,

    Aastha

  • Posted 14 January 2026, 12:07 pm EST

    I try prepare a sample with the issue for GridView + Grouping and footer Total row

    migration to ASP.NET MVC not possible now, time and money in the company, not available for migrations

    thanks

  • Posted 15 January 2026, 8:38 am EST

    Hello Enrique,

    There is no OnGroupAggregate server event in latest version. Instead, you’ll need to use the OnClientGroupAggregate client side event as follows:

    *.aspx.cs:

    public string CurrencySymbolHtml { get; set; }
    
    protected void Page_Load(object sender, EventArgs e)
    {
        // Get the culture-specific symbol and wrap it in HTML
        // Using System.Globalization.CultureInfo.CurrentCulture or your Util.GetCulture()
        var culture = System.Globalization.CultureInfo.CurrentCulture;
        string symbol = culture.NumberFormat.CurrencySymbol;
    
        // your <span> formatting
        CurrencySymbolHtml = $"<span style=\"max-width:85px;display:inline-block;overflow:hidden\">{symbol}</span>&nbsp;";
    
        if (!IsPostBack)
        {
            BindGrid();
        }
    }

    *.aspx:

    <script>
        // Pull the C# property into a global JS variable
        const CurrencySymbol = '<%= CurrencySymbolHtml %>';
    
        function OnClientGroupAggregate(sender, e) {
            //equivalent of your implementation
            let sum = 0;
            for (let i = e.groupingStart; i <= e.groupingEnd; i++) {
                let dataRows = e.data;
                sum += dataRows[i].valueCell(1).value;
            }
            console.log(sum);
    
            let formattedSum = sum.toLocaleString('en-US', {
                minimumFractionDigits: 2,
                maximumFractionDigits: 2
            });
    
            // Set the header text using the injected symbol
            e.text = CurrencySymbol +
                "<span style='max-width:85px;display:inline-block;overflow:hidden' id='" +
                sender.id + "_Total'>" + formattedSum + "</span>";
        }
    </script>
    
    <wijmo:C1GridView ID="C1GridView1" runat="server"
        ....
        OnClientGroupAggregate="OnClientGroupAggregate">
    
        <Columns>
            ....
        </Columns>
    </wijmo:C1GridView>

    Note that OnClientGroupAggregate works for the columns that have their Aggregate property set as Custom.

    Please refer to the attached sample for the implementation. (see GridView_Grouping.zip)

    Regards,

    Uttkarsh.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels