Hi
RJ,
Greetings
from Syncfusion support.
Based
on the information provided, it has been observed that you wanted to customize
the cell values based on the data bound to the Syncfusion Grid. To address your
requirement, we have developed a sample where we utilized the queryCellInfo
event of the Grid to customize the values of the cells according to your
requirement. Please refer to the code example, sample, and screenshot below for
more detailed information.
|
Index.cshtml
<div>
<ejs-grid id="grid01"
dataSource="@ViewBag.DataSource" allowPaging="true"
allowSorting="true" queryCellInfo="queryCellInfo">
<e-grid-columns>
…………………………………….
</e-grid-columns>
</ejs-grid>
</div>
<script>
function queryCellInfo(args)
{
let value = args.data[args.column.field];
if (typeof value === 'number') {
if (value === 0) {
args.cell.innerHTML
= '-'; // Show hyphen for 0
} else if (value < 0) {
args.cell.innerHTML
= `(${Math.abs(value)})`; // Show
parentheses for negative values
}
}
}
</script>
|
Sample: Please find in the
attachment.
Screenshot:

API
Reference:
queryCellInfo
If
you need any other assistance or have additional questions, please feel free to
contact us.
Regards
Aishwarya
R
Attachment:
194885Sample_b42cc853.zip