How to pre-check items in a ListView

Hi, how can I pre-check values in a listview.  As an example see the demo https://ej2.syncfusion.com/angular/demos/#/material/listview/checklist  , how would I for example have the checkbox for entry 'Maclaren F1'  selected when the component is first loaded? 

1 Reply

BM Balaji M Syncfusion Team August 31, 2018 07:18 AM UTC

Hi Jo, 

Thank you for using Syncfusion Products. 
We suggest to define ‘isChecked’ in field settings to pre-select the checkbox in ListView component 

  public data: Object = [ 
    { text: 'Hennessey Venom', id: 'list-01' }, 
    { text: 'Bugatti Chiron', id: 'list-02', isChecked: true }, 
    { text: 'Bugatti Veyron Super Sport', id: 'list-03'}, 
    { text: 'SSC Ultimate Aero', id: 'list-04', isChecked: true  }, 
    { text: 'Koenigsegg CCR', id: 'list-05' }, 
    { text: 'McLaren F1', id: 'list-06' }, 
    { text: 'Aston Martin One- 77', id: 'list-07', isChecked: true }, 
    { text: 'Jaguar XJ220', id: 'list-08' } 


Let us know if you have any queries. 

Regards, 
M. Balaji  


Loader.
Up arrow icon