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

data dont show in dropdownlist,combobox,autocoplete ,..

Thread ID:





145881 Jul 11,2019 07:39 PM UTC Jul 12,2019 11:41 AM UTC Blazor 3
Tags: Dropdown List
ebi torabi
Asked On July 11, 2019 07:39 PM UTC

in hosted core blazor data is taken from(using web api) the database but in the dropdownlist,combobox,autocoplete ,..

Gopi Govindasamy [Syncfusion]
Replied On July 12, 2019 07:35 AM UTC

Hi Ebi,   
Greetings from Syncfusion Support. 
We have prepared the sample for AutoComplete, ComBobox and DropDownlist in the hosted core blazor using web API services and data is fetched from the services in our end. Please find the code snippet below, 
        <EjsAutoComplete placeholder="Select a Employee" query="@Query"> 
            <EjsDataManager Url="/api/SampleData" Adaptor=@Syncfusion.EJ2.Blazor.Adaptors.WebApiAdaptor CrossDomain="true"></EjsDataManager> 
            <AutoCompleteFieldSettings Value="FirstName"></AutoCompleteFieldSettings> 
    <EjsComboBox PlaceHolder="Select a Employee" Query="@Query"> 
        <EjsDataManager Url="/api/SampleData" Adaptor="@Syncfusion.EJ2.Blazor.Adaptors.WebApiAdaptor" CrossDomain="true"></EjsDataManager> 
        <ComboBoxFieldSettings Value="FirstName"></ComboBoxFieldSettings> 
    <EjsDropDownList ID="Employees" PlaceHolder="Select a Employee" Query="@Query"> 
        <EjsDataManager Url="/api/SampleData" Adaptor="@Syncfusion.EJ2.Blazor.Adaptors.WebApiAdaptor" CrossDomain="true"></EjsDataManager> 
        <DropDownListFieldSettings Value="FirstName"></DropDownListFieldSettings> 
    public string Query { get; set; } = "new ej.data.Query().select(['FirstName']).take(7).requiresCount()"; 
WebApplication3.Server -> Controller 
public class SampleDataController : Controller 
        public List<Employees> result = new List<Employees>(); 
        // GET api/Employees  
        public object Get() 
            var queryString = Request.Query; 
            var data = Employees.GetAllRecords().ToList(); 
            if (queryString.Keys.Count != 0) 
                StringValues Skip; 
                StringValues Take; 
                int skip = (queryString.TryGetValue("$skip", out Skip)) ? Convert.ToInt32(Skip[0]) : 0; 
                int top = (queryString.TryGetValue("$top", out Take)) ? Convert.ToInt32(Take[0]) : Employees.GetAllRecords().Count(); 
                return new { result = data.Skip(skip).Take(top), count = Employees.GetAllRecords().Count() }; 
                return data; 
        // GET api/values/5 
        public string Get(int id) 
            return "value"; 
Note: For complete code, kindly refer to the server side application controller page 
Please find the sample below  
Gopi G. 

ebi torabi
Replied On July 12, 2019 08:47 AM UTC

Thanks for the great sample project .This code worked well for web api. But the data is not displayed in the list binding

Gopi Govindasamy [Syncfusion]
Replied On July 12, 2019 10:49 AM UTC

Hi Ebi, 

Thanks for your updating. 

We have checked your scenario, we suspect that the cause of the problem is that ASP.NET Core 1.0 + has camel casing problems while serializing the JSON Object. Please add the ContractResolver options to your application side under the Startup.cs file to avoid camel conversion during the serialization process. This relates to the specifics of ASP.NET Core and we recommend that you refer to the following article describing how to solve a comparable problem.  
please follow code snippet for your reference.  
[WebApplication3.Server -> StartUp.cs] 
      public void ConfigureServices(IServiceCollection services) 
            services.AddMvc().AddNewtonsoftJson(options => { 
                options.SerializerSettings.ContractResolver = new DefaultContractResolver(); 

Gopi G. 


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