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

DropDownList and form initialValue

2 Answers 1008 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
Veteran
John asked on 23 Mar 2021, 08:53 PM

Kendo's Form element has an initialValue prop which I can assign an object to. Inputs will use their "name" field to bind to the initialValue object however I am having trouble getting this to work with DropDownLists. 

Do DropDownLists work with a form's initial value if indeed the props (data, dataItemKey, textField, and name) are all set. The value of the binded field should match the dataItemKey's field.

 

Thanks

2 Answers, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
Veteran
answered on 23 Mar 2021, 09:25 PM

Ok I figured it out....

Basically the the initalValues' value for the given dropdownlist must match the objects in the data prop of the DropDownList exactly. I would have hoped that the dataItemKey would have been used when matching the initialValue for selection. Is this working as intended? How it works currently is severely limiting and makes using this component cumbersome.

 

See what I mean here:

https://stackblitz.com/edit/react-99es75-h6w5lm?file=app%2Fmain.jsx

 

 

Gregory
Top achievements
Rank 1
commented on 10 Aug 2021, 11:03 PM

My sentiments EXACTLY!!  

It's like the kendo folks don't use their products outside of their development environment and not in the "real" word.  How can a dropdown list not be bound to its dataItemKey--that y'all say is meant for an "id" or "KEY" is beyond me...
Stefan
Telerik team
commented on 11 Aug 2021, 04:54 AM

Hello, Gregory,

Thank you for sharing your honest feedback on this.

We had a couple of discussions on this subject as some of our older products like Kendo UI for jQuery have this. The main reason is that in some cases the developer needs the full object based on the ID and in other cases only the ID value from the object. No matter which approach we use, one group of developers may have to loop over the data and get the information their application needs.

We are constantly listening for the community feedback and trying the improve the components based on that.

0
Accepted
Stefan
Telerik team
answered on 24 Mar 2021, 08:47 AM

Hello, John,

I can suggest checking the following forum post on a similar subject where we have provided an example and more details about the case:

https://www.telerik.com/forums/combobox-binding-to-dataset-of-object

Please let me know if you have additional questions on this matter.

Regards,
Stefan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Veteran
Answers by
John
Top achievements
Rank 1
Veteran
Stefan
Telerik team
Share this question
or