This is a migrated thread and some comments may be shown as answers.

Combobox Server Filtering

1 Answer 72 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Kendo
Top achievements
Rank 1
Kendo asked on 25 Feb 2020, 12:42 AM

I'm doing Server Filtering on a combobox on selecting a school. School may have thousands of row.  I have it working fine but when I go back into Edit mode I was to display the Template to the selected saved record. I have what should be displayed as well as the ID in the ViewModel.  I tried Value and I tried do it in javascript but can't find a way. 

 

                                                            @(Html.Kendo().ComboBox()
                                                                     .Name("SchoolId")
                                                                     .Placeholder("Select School")
                                                                     .DataTextField("schoolName")
                                                                     .DataValueField("schoolId")
                                                                     .HtmlAttributes(new { @class = "form-control" })
                                                                     .Filter(FilterType.Contains)
                                                                     .AutoBind(false)
                                                                     .MinLength(3)
                                                                     .DataSource(source =>
                                                                     {
                                                                         source.Read(read =>
                                                                         {
                                                                             read.Action("GetSchools", "User");
                                                                             read.Type(HttpVerbs.Get);
                                                                         })
                                                                         .ServerFiltering(true);
                                                                     })
                                                                     .Template("#: data.schoolName # (#: data.schoolCity #, #: data.schoolState #)")
                                                            )

 

1 Answer, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 27 Feb 2020, 03:34 PM

Hi,

I am not 100% about the template you want to define. The templates that can be defined for the ComboBox component are available only in its dropdown field. The "Template" configuration defines a template for the items in the dropdown list as it can be observed in this Customizing templates demo. Is the "items template" you are trying to define? 

If you want to define a template for the selected item, this functionality is not supported by the ComboBox component. The selected item displays plain text only.

Please give me more details about the functionality you are trying to implement. If you want you can submit a support ticket and attach a runnable project to it.

Regards,
Petar
Progress Telerik

Get quickly onboarded and successful with Telerik UI for ASP.NET Core with the dedicated Virtual Classroom technical training, available to all active customers.
Tags
ComboBox
Asked by
Kendo
Top achievements
Rank 1
Answers by
Petar
Telerik team
Share this question
or