We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DataBind CheckBox Grid Column

Thread ID:





132366 Aug 29,2017 01:05 AM UTC Sep 18,2018 10:23 AM UTC Angular 6
Tags: ejGrid
Marcelo Blank
Asked On August 29, 2017 01:05 AM UTC

I have a databind DataGrid column  (Active) that is a boolean type (True/False or 1/0) ...

I want to display these column as checkbox, but not select the row ...

These code  for <e-column field="Active" [displayAsCheckBox]= "true"></e-column>  does not work
and these <e-column field="Active" headerText="Ativa" type="checkbox" rowSelected="false" width="50" ></e-column>
select the rows ...

<ej-grid id="g1" [dataSource]="empresas" allowPaging="true"
[toolbarSettings]="toolbarItems" [editSettings]="editSettings" >
<e-column field="Id" headerText="ID" [isPrimaryKey]="true" ></e-column>
<e-column field="Name" headerText="Company"></e-column>
<e-column field="Nick" headerText="Nick"></e-column>
<e-column field="Active" [displayAsCheckBox]= "true"></e-column>
<e-column field="Active" headerText="Ativa" type="checkbox" rowSelected="false" width="50" ></e-column>

What´s the right way to do these ?

Marcelo Blank
Replied On August 29, 2017 01:08 AM UTC

Follow the grid

Mani Sankar Durai [Syncfusion]
Replied On August 29, 2017 12:31 PM UTC

Hi Marcelo, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we found that you would like to show the column as checkbox when data is either true/false or 0/1. To achieve this we suggest you to set the type as “boolean” and when the type is “checkbox” it will select the rows when checking the checkbox. 
Refer the code example 
<e-column field=”Active” type=”boolean” [displayAsCheckBox] = “true” /> 

Note: if the checkbox should not select the row when checking don’t use the type as checkbox instead use it as Boolean. 
Refer the documentation link. 

Please let us know if you need further assistance. 

Manisankar Durai. 

Marcelo Blank
Replied On August 29, 2017 12:48 PM UTC

Great Manisankar

Works perfectly...



Mani Sankar Durai [Syncfusion]
Replied On August 30, 2017 06:20 AM UTC

Hi Marcelo, 

We are happy to hear that your problem has been solved.  

Please let us know if you need further assistance. 

Manisankar Durai. 

Aditi Patre
Replied On September 18, 2018 05:26 AM UTC

Unable to bind checkbox to a column (which holds boolean value) in a grid.

I'm creating a list of syncfusion grid columns
List<Column> cols = new List<Column>();

Dictionary<string, object> ReadOnlyDict = new Dictionary<string, object>();
 ReadOnlyDict.Add("style", "background-color:#eeeeee");

Adding column of boolean datatype to grid:

cols.Add(new Column() { Field ="ColumnName", HeaderText = "ColumnName", HeaderTooltip ="", Type = "boolean", DisplayAsCheckbox = true, TextAlign = TextAlign.Center, AllowEditing = false, Visible = true, CustomAttributes = ReadOnlyDict});

The grid does display checkbox but it isn't able to bind with the bit datafield. So although the value in database is 0 it is always mapping it as checked.

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On September 18, 2018 10:23 AM UTC

Hi Aditi,  
Based on the given code example, we have prepared a sample in the latest version of the Essential Studio ASP.Net MVC platform. The sample can be downloaded from the following location. 
We cannot reproduce the reported problem at our end. We have used the 0’s and 1’s as the value for the Boolean column which is binding value to the checkbox correctly. Please share the following details to analyze the problem at our end. 
  1. Essential studio version.
  2. Complete code example of the Grid (view and controller page)
  3. Model class of the Grid datasource
  4. Master page and web.config page of the application
  5. If possible, modify the attached sample and reproduce the issue.
Seeni Sakthi Kumar S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon