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. Image for the cookie policy date
close icon

How to pre select the checkbox column

Hi Experts,

I  have a query regarding the checkbox column. While creating column, I used showCheckBox as true to create check box column.
 How to pre select "Test1" and" "Test3"   while loading the tree table. 






5 Replies

PK Padmavathy Kamalanathan Syncfusion Team October 22, 2019 03:42 PM UTC

Hi SarathKumar, 

Thanks for contacting Syncfusion Forums. 

QUERY: How to preselect the checkbox column 

From your query we understand that you need to select the checkbox while the rendering the treegrid. We suspect that you need to check/uncheck the checkbox based on the filed value. 

For achieving that, you can use “displayAsCheckBox” property which render checkbox(checked/unchecked) based on the field value. 

Please refer the below sample, 

Please refer the below help documentations, 

Please get back to us if we have mis interpreted your query 

Regards, 
Padmavathy Kamalanathan 




SK Sarathkumar, K (K.) October 22, 2019 04:17 PM UTC

Hi Padmavathy Kamalanathan,

Need to create a separate column if “displayAsCheckBox” is used. But "showCheckBox" allows a check box within a column along with display name.
Also if I use the "displayAsCheckBox", need to double click to make it checked/unchecked . But with "showCheckBox" , check/unchecked will happen with a single click.
Please advice how to preselect with "showCheckBox" option 


PK Padmavathy Kamalanathan Syncfusion Team October 23, 2019 01:25 PM UTC

Hi SarathKumar, 

Thanks for your update. 

QUERY: How to preselect with “showCheckbox” option 
 
From your query we understand that you need to use “showCheckbox” property, in order to select particular record’s checkbox at initial rendering itself. 

This can be achieved by selecting those checkboxes using “selectCheckboxes” method in “dataBound” event. 

Please refer the below help documentation, 

In dataBound event, you need to call the selectCheckboxes method with the rowIndices (rowindices of records which you need to preselect) as parameter. 

Please refer the below sample, 

If you have further queries, please get back to us. 

Regards, 
Padmavathy Kamalanathan 



SK Sarathkumar, K (K.) October 29, 2019 11:18 AM UTC

Hi Padmavathy Kamalanathan,
 The solution provided fulfilled my requirement ...

I have another query regarding the column visibility. How to make the specific column (say, checkbox column ) visible on a button click?

Thanks and regards,
Sarathkumar.K


PK Padmavathy Kamalanathan Syncfusion Team October 31, 2019 02:38 AM UTC

Hi SarathKumar,

Thanks for your update. You can show or hide column in buttonclick by using showColumns and hidColumns method.

Please check the below help documentations,
https://ej2.syncfusion.com/documentation/api/treegrid/#hidecolumns


 We have checked this with checkbox column and found issue with header column's checkbox. Thank you for the taking the time to report the issue and helping us improve our product. At Syncfusion we are committed to fixing all the validated defect (subject to technological feasibility and Product Development Life Cycle) and including its fix in our subsequent release. So fix for the issue will be included in our upcoming patch release which is expected to be rolled out in the second week of November 2019.
 
  
You can track the current status of your request, review the resolution timeline and contact us for any further inquiries through this link 

 
Disclaimer: The feedback link is in review state and you can check it once it is validated 
  
Note: To view the above feedback, kindly login into your account. 
  
If you have further queries, please get back to us. 
  
Regards, 
Padmavathy Kamalanathan 
  


Loader.
Live Chat Icon For mobile
Up arrow icon