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

Hi. All the data we get from the database is not displayed in the combo box

Thread ID:

Created:

Updated:

Platform:

Replies:

148102 Oct 6,2019 06:30 AM UTC Oct 7,2019 10:05 AM UTC Blazor 1
loading
Tags: ComboBox
ebi torabi
Asked On October 6, 2019 06:30 AM UTC

Hi. All the data we get from the database is not displayed in the combo box and only some of it is displayed.


<div class="col-lg-12 control-section">
    <div class="control_wrapper">
        <div class="col-lg-12 control-section">
            <div class="control_wrapper">
                <EjsComboBox @ref="@se" Placeholder="نام دارو را وارد کنید" FloatLabelType="FloatLabelType.Auto" DataSource="@CommerceDrugsNameList" ModelType="kl" Query="@Query" TValue="int" AllowFiltering="true" EnableRtl="true">
                    <ComboBoxEvents TValue="int"  Filtering="@CommerceDrugsNameFilter"></ComboBoxEvents>
                    <ComboBoxFieldSettings Value="Id" Text="Name"></ComboBoxFieldSettings>
                </EjsComboBox>
            </div>
        </div>
    </div>
</div>


@code
{

 NameId[] CommerceDrugsNameList;
 public async Task CommerceDrugsNameFilter(Syncfusion.EJ2.Blazor.DropDowns.FilteringEventArgs args)

    {

        if (args.Text.Length > 0)
        {
            CommerceDrugsNameList = await http.GetJsonAsync<NameId[]>($"api/CommerceDrugsName/GetNameIdByNameFiltering/{args.Text}");
            se.DataSource = CommerceDrugsNameList;
            se.DataBind();

        }

        else
            CommerceDrugsNameList = null;
        StateHasChanged();
    }
}

Attachment: combobox_3a61fa00.rar

Sureshkumar P [Syncfusion]
Replied On October 7, 2019 10:05 AM UTC

Hi Ebi torabi, 


Greetings from Syncfusion support, 

We have checked your attached block code and we presume that you have the value in the popup based on your filtering technique. To meet your requirements, we suggest using our inbuild Filter method. We've modified and updated your block of code here. 

Kindly refer the code block. 

public async Task CommerceDrugsNameFilter(Syncfusion.EJ2.Blazor.DropDowns.FilteringEventArgs args) 
    { 
        if (args.Text.Length > 0) 
        { 
            CommerceDrugsNameList = await http.GetJsonAsync<NameId[]>($"api/CommerceDrugsName/GetNameIdByNameFiltering/{args.Text}"); 
            se.Filter(CommerceDrugsNameList); 
        } 
        else 
            CommerceDrugsNameList = null; 
        StateHasChanged(); 
    } 


If we misunderstood your query, please revert as with the comprehensive and exact scenario that you have faced. That will help us to provide exact solution at our end earliest. 

Regards, 
Sureshkumar P 


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