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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Fill the ddl directly after creation

Thread ID:





145731 Jul 5,2019 10:19 AM UTC Jul 6,2019 10:14 AM UTC Blazor 2
Tags: Dropdown List
Asked On July 5, 2019 10:19 AM UTC

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>


Berly Christopher [Syncfusion]
Replied On 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> 

Please find the sample below link 

Berly B.C 

Replied On July 6, 2019 10:14 AM UTC

Thx, works perfectly.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon