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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

data doesn't show in dropdownlist,combobox,autocoplete ,..

Thread ID:

Created:

Updated:

Platform:

Replies:

146117 Jul 20,2019 09:58 PM UTC Jul 26,2019 06:48 PM UTC Blazor 3
loading
Tags: AutoComplete
ebi torabi
Asked On July 20, 2019 09:58 PM UTC

<div class="control-section col-lg-12">
    <div id='remote-data' class="col-lg-6">
        <div class='content'>
            <h4>Remote Data</h4>
            <EjsAutoComplete @ref="@AutoComplete" placeholder="Select a name">
                <EjsDataManager Json="@AutoCompleteData" Adaptor="@Adaptors.JsonAdaptor"></EjsDataManager>
                <AutoCompleteFieldSettings Value="AllergyId" Text="AllergyName"></AutoCompleteFieldSettings>
            </EjsAutoComplete>
        </div>
    </div>
</div>

@code{

Allergies[] AutoCompleteData;

EjsAutoComplete AutoComplete;

protected override async Task OnAfterRenderAsync()
{
    AutoCompleteData =await http.GetJsonAsync<Allergies[]>("api/Allergies");
    }
}



[HttpGet]

        public object Get()
        {
            
            IEnumerable<Allergies> data = db.GetAll().AsQueryable();
            var count = data.Count();
            var queryString = Request.Query;
            if (queryString.Keys.Contains("$inlinecount"))
            {
                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]) : data.Count();
                return new { Items = data.Skip(skip).Take(top), Count = count };
            }
            else
            {
                return data;
            }
        }


Berly Christopher [Syncfusion]
Replied On July 22, 2019 09:35 AM UTC

Hi Ebi,   
  
 
Sorry for the inconvenience. 

Currenlty, we are validating the reported problem and we will update the further information on July 24, 2019. 
  
  
Regards, 
Berly B.C 


Berly Christopher [Syncfusion]
Replied On July 24, 2019 11:38 AM UTC

Hi Ebi,   
  
  
Thanks for the patience.  
  
  
We analyzed your code and found that you used the JSON Adapter and assigned the data returned by the API to DataManager which causes the problem. Instead, we recommend you to directly assign the data returned by the API to the DataSource property. 
  
 
[Index.razor] 
  
<div class="control-section col-lg-12"> 
    <div id='remote-data' class="col-lg-6"> 
        <div class='content'> 
            <h4>Remote Data</h4> 
            <EjsAutoComplete DataSource="@AutoCompleteData" placeholder="Select a name"> 
                <AutoCompleteFieldSettings Value="FirstName"></AutoCompleteFieldSettings> 
            </EjsAutoComplete> 
        </div> 
    </div> 
</div> 
 
@code{ 
 
 
   Employees[] AutoCompleteData; 
 
    protected override async Task OnInitAsync() 
    { 
        AutoCompleteData = await http.GetJsonAsync<Employees[]>("api/SampleData"); 
    } 
} 

  
Please find the sample below, 


  
Regards, 
Berly B.C 


ebi torabi
Replied On July 26, 2019 06:48 PM UTC

Thank you so much for your example

CONFIRMATION

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