Hi Nagendra Gupta,
Thanks for contacting Syncfusion support.
You can achieve your requirement by using the “valueAccessor”
method of Grid columns. Inside this method you will get the current row and column
details and based on your condition, you can format the data and return it to
display in the cells. Please refer to the below code example, documentation, and
sample link for more information.
|
<e-column field="Freight" width="120" textAlign="Right" [valueAccessor]="valueAccess"></e-column>
public valueAccess = (field: string, data1: object, column: object) => {
const fmt: string = data1['OrderID'] % 2 ? 'N2' : 'N3';
let formattedString: string = this.intl.formatNumber(data1[field], {
format: fmt,
});
return formattedString;
};
|
Documentation: https://ej2.syncfusion.com/angular/documentation/grid/columns/columns/#valueaccessor
Sample : https://stackblitz.com/edit/angular-xdaj1l?file=app.component.html,app.component.ts
Please get back to us if you need further as on this.
Regards,
Pavithra S