OnClientColumn client events C1GridView 2025v2 399

Posted by: enrique.pv-ext on 7 May 2026, 9:58 am EST

  • Posted 7 May 2026, 9:58 am EST - Updated 7 May 2026, 10:00 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

    using C1.Web.Wijmo.Controls.C1GridView;

    When use OnClientColumn events javascript ?

        ClientSelectionMode="SingleRow"
        OnClientSelectionChanged="C1GridView1_OnClientSelectionChanged"
        OnClientColumnGrouping="C1GridView1_OnClientColumnGrouping"
        OnClientColumnGrouped="C1GridView1_OnClientColumnGrouped"
        OnClientColumnUngrouped="C1GridView1_OnClientColumnUngrouped"

    Javascript

        var collectionReportsGroupedCount = 0;
        function C1GridView1_OnClientColumnGrouping(s, e) {
            if (collectionReportsGroupedCount >= 1) {
                if (e && typeof e.set_cancel === "function") {
                    e.set_cancel(true);
                }
                showSingleGroupingWarningClient();
                return false;
            }
            return true;
        }
    
        function C1GridView1_OnClientColumnGrouped(s, e) {
            collectionReportsGroupedCount = 1;
        }
    
        function C1GridView1_OnClientColumnUngrouped(s, e) {
            collectionReportsGroupedCount = 0;
        }

    Any suggestions ?

  • Posted 8 May 2026, 4:51 am EST

    Hi,

    As I can see from the documentation there is no OnClientColumnGrouped and OnClientColumnUnGrouped event.

    Please let me know what documentation you are referring to where these events are listed, so we can get that corrected.

    As per the documentation, there are only OnClientColumnGrouping & OnClientColumnUngrouping client-side events, which seem to be working fine on my side.

    You can use these events to perform client-side actions or manage state within your application.

    Regards,

    Akshay

  • Posted 8 May 2026, 5:18 am EST

    Sorry, your’re right, client-side events are:

    OnClientColumnDragged A function called when column dragging has been started.

    OnClientColumnDragging A function called when column dragging is started, but before wijgrid handles the operation. Cancellable.

    OnClientColumnDropping A function called when column is dropped, but before wijgrid handles the operation. Cancellable.

    OnClientColumnGrouping A function called when column is dropped into the group area, but before wijgrid handles the operation. Cancellable.

    OnClientColumnUngrouping A function called when column is removed from the group area, but before wijgrid handles the operation. Cancellable.

    OnClientSelectionChanged="C1GridView1_OnClientSelectionChanged"
    OnClientColumnGrouping="C1GridView1_OnClientColumnGrouping"
    OnClientColumnUngrouping="C1GridView1_OnClientColumnUngrouping"

    I try ?

        function getCurrentGroupedCount() {
            var grid = $("#<%= C1GridView1.ClientID %>");
            return grid.find(".wijmo-wijgrid-groupheader").length;
        }
        function C1GridView1_OnClientColumnGrouping(s, e) {
            var groupedCount = getCurrentGroupedCount();
            if (groupedCount >= 1) {
                if (e && typeof e.set_cancel === "function") {
                    e.set_cancel(true);
                }
                if (typeof showSingleGroupingWarningClient === "function") {
                    showSingleGroupingWarningClient();
                }
                return false;
            }
            return true;
        }
    
        function C1GridView1_OnClientColumnUngrouping(s, e) {
            return true;
        }

    and samples using

    OnClientColumnDragged

    OnClientColumnDragging

    OnClientColumnDropping

    thanks in advanced, any help very high appreciated?

  • Posted 11 May 2026, 2:25 am EST

    Hi,

    I tried to run your code; however, getCurrentGroupedCount is always returning 0 for me.

    You may refer to the following code to get the Group Count.

    <script>
        function C1GridView1_OnClientColumnGrouping(s, e) {
    
            var gridElement = s.target;
            var $grid = $(gridElement);
            var widget = $grid.data("wijmo-c1gridview") || $grid.data("wijmo-wijgrid") || $grid.data("wijgrid");
            console.log($grid)
            if (widget && widget.options && widget.options.columns) {
                var groupedCount = 0;
                var cols = widget.options.columns;
    
                // Count columns that currently have an active group position
                for (var i = 0; i < cols.length; i++) {
                    var gInfo = cols[i].groupInfo;
                    if (gInfo && gInfo.position) {
                        var pos = gInfo.position.toString().toLowerCase();
                        if (pos !== "none" && pos !== "0") {
                            groupedCount++;
                        }
                    }
                }
    
                // If 1 or more columns are already grouped, block the action and show alert
                if (groupedCount >= 1) {
                    alert("Grouping is limited to 1 column at a time.");
    
                    // Cancel the ASP.NET AJAX grouping event
                    if (e && typeof e.set_cancel === "function") {
                        e.set_cancel(true);
                    }
                    return false;
                }
            }
        }
        </script>
    

    >> samples using OnClientColumnDragged OnClientColumnDragging OnClientColumnDropping

    Since this is a new query, please create a separate case for this.

Need extra support?

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

Learn More

Forum Channels