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

Fill the ddl directly after creation

Do you know a way to retrieve data right after the creation and without the need to click on the arrow ?

Here's my sample :

<EjsDropDownList ID="ddlTest" @Ref=@ddlTest Width="150px" >
    <EjsDataManager Offline="true" Url="http://localhost/BlazorTests.Server/api/values" Adaptor="Adaptors.WebApiAdaptor" CrossDomain="true"></EjsDataManager>
    <DropDownListFieldSettings Text="text" Value="value"></DropDownListFieldSettings>
</EjsDropDownList>

Thx.

2 Replies

BC Berly Christopher Syncfusion Team July 5, 2019 01:56 PM UTC

Hi Brice,   
  
 
Greetings from Syncfusion Support. 
  
 
Yes, you can retrieve the DopDownList data on initial loading (without interaction) by setting the Index property as “-1”. If you set a positive value for the index property then, the specified value in the given index value will be updated in component as preselect value.  
  
Please find the below code 

<EjsDropDownList ID="ddlTest" Width="150px" Index=-1> 
    <EjsDataManager Url="https://ej2services.syncfusion.com/production/web-services/api/Employees" Adaptor="Adaptors.WebApiAdaptor" CrossDomain="true"></EjsDataManager> 
    <DropDownListFieldSettings Text="FirstName" Value="EmployeeID"></DropDownListFieldSettings> 
</EjsDropDownList> 


  
Please find the sample below link 

  
Regards, 
Berly B.C 




BF Brice FROMENTIN July 6, 2019 10:14 AM UTC

Thx, works perfectly.

Loader.
Live Chat Icon For mobile
Up arrow icon