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

How to customize the grouping row data in React Grid

It is posible to customize the grouping row data?

I want to set the row text to something like --> TOTAL of group: xxxx

1 Reply

PK Prasanna Kumar Viswanathan Syncfusion Team January 29, 2020 09:15 AM UTC

Hi Oscar, 
Greetings from syncfusion support 
Query#: I want to set the row text to something like --> TOTAL of group: xxxx 
From analyzing your query we understand you want to customize the grouping row text in grid. You can customize the group caption by using the groupSettings.captionTemplate property.  
Please refer the below code example, sample and documentation for more information. 

export class Grouping extends SampleBase { 
    constructor() { 
        this.groupOptions = { showGroupedColumn: false, columns: ['Country'], 
    dataBound() { 
        if (refresh) { 
            refresh = false; 
    load() { 
        refresh = this.refreshing; 
    render() { 
        return (<div className='control-pane'> 
                <div className='control-section'> 
                    <GridComponent dataSource={inventoryData} allowPaging={true} ref={grid => this.gridInstance = grid} pageSettings={{ pageCount: 5 }} allowGrouping={true} groupSettings={this.groupOptions} allowSorting={true} height="320" dataBound={this.dataBound.bind(this)} load={this.load}> 
                             .  .  .  .  .  .  . 
                             .  .  .  .  .  .  . 
                        <Inject services={[Page, Group, Sort]}/> 

<script id="groupTemplate" type="text/x-template"> 
        <script type="text/javascript"> 

function groupTemplate(args) { 
    if (args.field == "Country") {            //we have customize the caption only for country field 
        return "TOTAL of group:" + args.count + " item"; 
Prasanna Kumar N.S.V

Live Chat Icon For mobile
Up arrow icon