We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Accessing the Grid Grouping Summary Cells.

Hi Syncfusion,

Is there a way accessing the summary cells directly to change their values and avoid using the grid engines way of creating summaries, where an object is created for each row and then combined?

I've seen significant speed improvements if I don't use summaries, so if I can get our database to calculate the summaries and fill the cell in directly it would make the display of the grid much faster.

I would like to use the group level and category text and summary descriptor to access the summary cell.

-Tobias

7 Replies

RC Rajadurai C Syncfusion Team November 9, 2009 12:18 PM UTC

Hi Tobias,

Thanks for your interest in Syncfusion Products.

Using summaries in gridgroupingcontrol, would not have any peformance hit. If you would like to access the summary cell or set value to the summary cell, you can handle the QueryCellStyleInfo event.

if (e.TableCellIdentity.TableCellType == GridTableCellType.SummaryFieldCell)
{
// This line will display/extract the value from the matched cell
MessageBox.Show(e.Style.CellValue.ToString());

// This line will allow the setting of new value for the matched cell
e.Style.CellValue = "200";
}

In this event, you can access the specific element and handle the necessary modifications in it accordingly.

Regards,
Rajadurai


TO Tobias O''Leary November 11, 2009 12:36 PM UTC

Thanks for the reply. I'll try that out.


RC Rajadurai C Syncfusion Team November 12, 2009 03:34 AM UTC

Hi Tobias,

Thanks for your update.

Regards,
Rajadurai


HU Hussain July 26, 2017 12:08 PM UTC

is it possible to do the same thing with ejgrid for javascript/angularjs



TS Thavasianand Sankaranarayanan Syncfusion Team July 27, 2017 04:12 PM UTC

Hi Tobias, 

We have analyzed your query and we suspect that you want to use custom summary in ejGrid control. 

Refer the below code example. 


    <div id="Grid" ej-grid e-datasource="data" e-allowpaging="true" e-showsummary="true" e-summaryrows="summary"> 
        <div e-columns> 
         ---------- 
           <div e-column e-field="Freight" e-headertext="Freight" e-textalign="left" e-format="{0:c2}" e-width="90"></div> 
            ----------                     
 
   </div> 
    <script> 
        angular.module('listCtrl', ['ejangular']) 
        .controller('PhoneListCtrl', function ($scope) { 
            $scope.data = window.gridData; 
            $scope.summary = [{ 
                title: "Currency", 
                summaryColumns: [{ 
                    summaryType: ej.Grid.SummaryType.Custom, 
 
                    customSummaryValue: currency, 
 
                    displayColumn: "Freight", 
                    format: "{0:c2}" 
                }] 
            }] 
        }); 
        function currency() { 
            //to get grid instance 
            var gridObj = $("#Grid").ejGrid("instance"); 
            //ej.sum is aggreagte to add datas of freight from datasource 
             
            return ej.sum(gridObj.model.dataSource(), "Freight"); 
        } 
    </script> 


We have prepared a JsPlayground sample in the following link. 


Refer the help documentation. 


If we misunderstood your query then please get back to us. 

Regards, 
Thavasianand S. 



HU Hussain September 20, 2018 01:21 PM UTC

Hi there.
i am using ejgrid for angularjs.
what i need is when grouping a column, summary cell title change from "sum" to "sum of {group key}", and the total grid summary row title remain the same.
i tried using queryCellInfo but it's only fetches data cells only.

example:-

current grid result :

namedatehoursquantitytotal
id: 1 - 3 items
John01/09/2018830240
John02/09/2018830240
John03/09/2018830240
Sum   720
id: 2 - 3 items
Mark01/09/2018730210
Mark02/09/2018730210
Mark03/09/2018830240
Sum   660
Sum   1380


desired grid result : summary row cell title has the key of the grouped column

namedatehoursquantitytotal
id: 1 - 3 items
John01/09/2018830240
John02/09/2018830240
John03/09/2018830240
Sum of 1   720
id: 2 - 3 items
Mark01/09/2018730210
Mark02/09/2018730210
Mark03/09/2018830240
Sum of 2   660
Sum   1380



PK Prasanna Kumar Viswanathan Syncfusion Team September 21, 2018 12:51 PM UTC

Hi Hussain, 

Sorry for the inconvenience caused. 

Based on our current implementation architecture it is not feasible to achieve your requirement. When we try to achieve your requirement in application side it gets more complicated when the number of grouping columns increased. So, it is not feasible to achieve your requirement.  

Regards, 
Prasanna Kumar N.S.V 


Loader.
Live Chat Icon For mobile
Up arrow icon