How can I change aggregate cell content

Posted by: bhati.bhati on 22 August 2019, 7:52 am EST

    • Post Options:
    • Link

    Posted 22 August 2019, 7:52 am EST

    Hi,

    I want to change the cell content of aggregate value in flex grid and want to apply different text color to it. I tried with formatItem but it does not recognize the last row which is used for aggregate values. how can I achieve it. can someone help.

    Thanks ,

    Deepak

  • Posted 23 August 2019, 12:10 am EST

    Hi Deepak,

    To change the cell content of the aggregate row, simply use the setCellData method of columnFooters panel of the FlexGrid:

    grid.columnFooters.setCellData(0, col.index, 'Custom Aggregate')
    

    And to change the text color using formatItem event:

    grid.formatItem.addHandler((s, e) => {
    	if (e.panel == s.columnFooters && e.panel.columns[e.col].binding === 'amount') {
    		e.cell.style.color = 'brown'
    	}
    });
    

    You may refer to the sample below:

    https://stackblitz.com/edit/angular-2jaaoh

    Regards,

    Ashwin

  • Posted 23 August 2019, 4:35 am EST

    Thanks Ashwin, it worked for me.

Need extra support?

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

Learn More

Forum Channels