Hi Eric,
Greetings from Syncfusion support.
We have checked your query and implemented a solution to
render the checkbox only for true and false values using ngIf and the column
template feature of the Grid, and for null values, nothing is rendered. We
suggest using the below code snippet to achieve this:
[app.component.html]
<ejs-grid #grid id="grid" [dataSource]='data'
[allowPaging]='true' [pageSettings]='pageSettings'>
<e-columns>
<e-column field='ProductID' headerText='Product ID' width='120'
textAlign='Right'></e-column>
<e-column field='ProductName'
headerText='Product Name' width='150'></e-column>
<e-column
field='Discontinued' headerText='Discontinued'
width='130' textAlign='Center'>
<ng-template #template let-data>
<ng-container *ngIf='data.Discontinued == true || data.Discontinued
== false'>
<ejs-checkbox [checked]='data.Discontinued'
[disabled]='true'></ejs-checkbox>
</ng-container>
</ng-template>
</e-column>
</e-columns>
</ejs-grid>
|
You can find the sample at the following link:
Sample: https://stackblitz.com/edit/angular-ppdkb4?file=src%2Fapp.component.html
Please feel free to reach out to us if you have any further
queries.
Regards,
Santhosh
I