Unplanned
Last Updated: 01 Oct 2025 07:31 by ADMIN
Brianna
Created on: 16 Sep 2025 19:32
Category: DropDownList
Type: Bug Report
2
ReferenceError: [X] is not defined on SelectListItem properties when using BindTo()

When binding a dropdown to a list (with .BindTo()) instead of a DataSource, none of the object's properties besides "Text" and "Value" are available in the Template, and will throw a ReferenceError that the property is not defined.

But this only occurs if the list of items it is bound to is of the type SelectListItem, or inherits from that type.

If the list is of items that do not inherit from SelectListItem, then all properties can be used in the Template with no error.

Screenshot of example project output:

Explanation:

Each dropdown on the page has a .Template() which simply displays the "Text" property and one other property (listed in each section's heading). Example: 

"#= Text # - #= Disabled #"

If the property is not working correctly, a unhandled ReferenceError will occur and the dropdown will fail to initialize. These failed rows are highlighted red.

This only occurs when the dropdowns use .BindTo() and a list of either SelectListItems or of a class that inherits from SelectListItem. The dropdowns bound to lists of CustomSelectListItem, which does not inherit, have no issue with the additional properties.

 

This bug has been occurring since at least 2021.3.1109, but I confirmed is still present in the latest version.

Attached Files:
3 comments
ADMIN
Anton Mironov
Posted on: 01 Oct 2025 07:31

Hello Brianna,

Thank you for pointing this one out to our attention. 

I spoke with the developers of the editors for the Kendo UI and from MVC/Core. This is a decision that was made more than 10 years ago - the SelectListItem class is a System.Web.Mvc one, and we would recommend using a custom class if other properties than Text and Value are needed.

 However, it is an edge case, but I will discuss this with the Team for adding the information in the documentation.

 

Kind Regards,
Anton Mironov
Progress Telerik

Your perspective matters! Join other professionals in the State of Designer-Developer Collaboration 2025: Workflows, Trends and AI survey to share how AI and new workflows are impacting collaboration, and be among the first to see the key findings.
Start the 2025 Survey
Brianna
Posted on: 25 Sep 2025 17:03

If this is something you don't intend to fix for some reason, could you make note of this behavior somewhere in the documentation page for the DropDownList and any other controls that have the same bug? (Multiselect, ComboBox, others?)

https://www.telerik.com/aspnet-mvc/documentation/api/kendo.mvc.ui.fluent/dropdownlistbuilder

ADMIN
Anton Mironov
Posted on: 23 Sep 2025 08:53

Hello Brianna,

Thank you for the images, the sample project, and the details provided.

I was able to run the sample project on my side and replicate the same behavior on my side.

The error happens because while our server sends the correct JSON fields (Disabled, Selected, Group, etc.), the Kendo DropDownList only maps the configured fields (Text, Value) by default. To use extra fields in templates, I would recommend using a custom Model as the "CustomSelectListItem".

I will also comment on this with the senior developers and will discuss if this behavior will be changed in the future.

Thank you for pointing out this one to our attention.

 

Kind Regards,
Anton Mironov
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.