set defaut value of checkbox selection

Hi, I am making checkbox in datagrid but i don't know how to set its value to true or false right on initialization. I want when I initialize, some cells will be checked already. can you help me?


3 Replies

RR Rajapandi Ravi Syncfusion Team September 7, 2021 01:38 PM UTC

Hi Toan, 

Greetings from Syncfusion support 

From your update, we could see that you have a Boolean column, and you like to display a checkbox with check/uncheck based on the Boolean value for that column. To render Boolean values as checkbox in columns, you need to set displayAsCheckBox property as true.  

We have already discussed about your requirement in our documentation. Please refer the below documentation for more information. 


Regards, 
Rajapandi R 



TB Toan Bui September 9, 2021 04:22 AM UTC

Hi, thank for your answer. But I'm using  <e-column [allowSorting]="false"></e-column> . I want to edit checkbox without entering editing mode. Can you help me?



AG Ajith Govarthan Syncfusion Team September 10, 2021 09:22 AM UTC

Hi Toan Bui, 

Thanks for the update. 

Query Hi, thank for your answer. But I'm using  <e-column [allowSorting]="false"></e-column> . I want to edit checkbox without entering editing mode. Can you help me? 
 
We have checked your query and found that you need to render the checkbox state based the field values. So, before we proceed to your query, please share the below details to validate further on your requirement. 

  1. Share the complete Grid code example.

  1. Share the datasource bound to the Grid component.
 
  1. Do you want to select the rows based on the field values with checkboxes?
 
  1. Do you want to use the column template to render the checkboxes based on the column template?
 
  1. Share the Syncfusion package version.
 
Regards, 
Ajith G. 


Loader.
Up arrow icon