combobox initial value and remote datasource

2 Answers 9 Views
ComboBox
Gerardo
Top achievements
Rank 1
Iron
Veteran
Iron
Gerardo asked on 20 Jul 2025, 06:43 AM

hi, I'm using a combobox like the one below, when the model already has a country assigned, the combobox shows the Id instead of the Name.
At page load I can see that the URL Countries is requested, however this doesn't make a difference. 

so the question is, how can I to set the initial value?. I've read examples but they all use a local datasource with bind-to, not a remote datasource.  is this possible?

regards

                <kendo-combobox for="CountryId" suggest="true"
                                datatextfield="Name"
                                datavaluefield="Id" filter="FilterType.Contains">
                    <datasource server-filtering="true">
                        <transport>
                            <read url="@Url.Action("Countries", "Common")"/>
                        </transport>
                    </datasource>
                </kendo-combobox>

 

2 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 21 Jul 2025, 12:10 PM

Hello Gerardo,

 

You can achieve this requirement using the following solution:

        <kendo-combobox ... text="che" >
JS:
<script>
    $(document).ready(function(){
        var combo=$("#products").data().kendoComboBox;
        combo.search(combo.text());
    });
</script>
Here is a live example I have prepared for you:
https://netcorerepl.telerik.com/QTuLwbPw10u4Cj7212

Do you find it helpful?

 

Regards,
Eyup
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Gerardo
Top achievements
Rank 1
Iron
answered on 21 Jul 2025, 05:22 PM
thanks Eyup!
Tags
ComboBox
Asked by
Gerardo
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Eyup
Telerik team
Gerardo
Top achievements
Rank 1
Iron
Share this question
or