Checkbox in Grid

How to create grid column which holds boolean value just to display it. If I create column like .Type("checkbox"), the grid changes the header of the column also, and the values are not shown right.

I tried with column template, but with no luck.

Thanks!
Bernard.

2 Replies

BJ Bernard Jurlina June 11, 2018 08:05 AM UTC

I just found one example for the checkbox in the grid.
I'll try to use DisplayAsCheckBox(true) when creating the column.

Bernard.


RS Renjith Singh Rajendran Syncfusion Team June 12, 2018 10:50 AM UTC

Hi Bernard, 

Thanks for contacting Syncfusion support. 

We have analyzed your query. Based on your requirement, we suggest you to set the column Type as “boolean” and then use the DisplayAsCheckbox property. Please refer the code example below, 

@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource) 
.Columns(col => 
{ 
    ... 
   col.Field("Verified").HeaderText("Verify").Type("boolean").DisplayAsCheckBox(true).Add(); 
}) 
.Render() 
 

In the above code, the Verified field contains Boolean values. Please refer the documentation links below, 

Documentations :  
 
Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 


Loader.
Up arrow icon