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
close icon

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

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

1 Reply

SP Sureshkumar P Syncfusion Team 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 


Loader.
Live Chat Icon For mobile
Up arrow icon