Declined
Last Updated: 11 Jun 2025 15:31 by ADMIN
CMS HS
Created on: 05 Jun 2025 11:38
Category: ListBox
Type: Feature Request
0
StackOverflowException on ListBox Data binding

Hi,

I'm using two TelerikListBox elements, one left, one right. The right ones Data attribute is bound to already selected items that I get from the DB through EF Core. As you know, EF Core makes use of navigation properties. As you probably also know, the TelerikListBox recursively copies elements on binding. This causes a documented StackOverflowException, as written here -> https://www.telerik.com/blazor-ui/documentation/knowledge-base/common-stackoverflowexception-editing-circular-references.

I fixed the issue by calling 

.Select(x => x.RemoveNavigation())

before binding, with RemoveNavigation being a simple "NavigationProp = null; return this;" function.

Eventhough this works, I think

a) the documented solution is not great, because the navigation properties are very useful, are one of the big reasons to even use EF Core in the first place and are automatically generated by, for example, EF Core Power Tools. Expecting the users to remove them from affected models is not a viable long term solution.

b) it would be better for Telerik to fix the issue by implementing some kind of logic to prevent the issue alltogether. My suggestion would be to ignore virtual, non-collection object properties on copy. 

1 comment
ADMIN
Ivan Danchev
Posted on: 11 Jun 2025 15:31

Hi,

Thank you for submitting this feature request.

After preliminary analysis of the source code the team decided to decline this feature request for the reasons stated below:

1. We would like to avoid adding workarounds to the source code that target specific data providers (in this case EF). Instead, we want to promote binding to data that is properly structured and in accordance to what the respective components expect. 

2. Addressing this case would affect multiple components, because the relevant logic in the source code is not specific to the ListBox. It is reused across the board in many other components.

3. By introducing changes and adding complexity to common logic used by multiple components, we risk introducing a breaking change/-s that may affect the user base. 

Regards,
Ivan Danchev
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.