Category / Section
How to format the cell values in TreeGrid?
1 min read
In Tree Grid we can customize column with different data formats like Currency, Date, Numeric and Percentage by using “format” property of “columns”. The below code example explains about how to format the columns in Tree Grid.
<div id="TreeGridContainer" style="height:400px;width:100%"></div> <script type="text/javascript"> $(function () { $("#TreeGridContainer").ejTreeGrid({ // columns: [ { field: "Number", format: "{0:n2}", editParams: { decimalPlaces: 3, incrementStep: 0.01 }, editType: ej.TreeGrid.EditingType.Numeric, }, { field: "Currency", format: "{0:c2}", editParams: { decimalPlaces: 2, incrementStep: 0.01 }, editType: ej.TreeGrid.EditingType.Numeric }, { field: "Percentage", format: "{0:P0}", editParams: { decimalPlaces: 2, incrementStep: 0.1 }, editType: ej.TreeGrid.EditingType.Numeric }, ], }) }); </script>
Screen shot:
Sample link:
A Sample to format the cell values of Tree Grid columns is available in the below link