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

Adding default selections

is it possible for me to put in some already selected items when the page loads instead of always loading empty

1 Reply

SP Sureshkumar P Syncfusion Team October 30, 2019 06:42 AM UTC

Hi Nurudeen, 
Greetings from Syncfusion support. 
We can set the pre-selected value to multiselect component using our inbuild value property. Kindly refer the below code block  
<MultiSelectComponent id="customelement" dataSource={this.gameList} fields={this.fields} mode="Box" 
               value={this.preselectValues} placeholder="Favorite sports" /> 
We created a sample based on your requirement. please refer the sample here: https://stackblitz.com/edit/react-pohmde?file=index.js  
To know more about the value property please refer the below API documentation link: https://ej2.syncfusion.com/react/documentation/api/multi-select#value  
Sureshkumar P 

Live Chat Icon For mobile
Up arrow icon