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

Html.DropDownListFor working better with CSS than Kendo().DropDownList()

1 Answer 423 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 30 Oct 2017, 05:48 PM

The Kendo DropDownList seems to take forever to load css. The values are loaded immediately although what is in the dropdown is the value not the text. The page is creating numerous dropdowns. It depends on the call but approximately 300. It works flawlessly with the mvc DropDownListFor. The Kendo call uses this:

@(Html.Kendo().DropDownList().Name("Reason" + person.Id.ToString()).DataTextField("Text").DataValueField("Value").BindTo(@Model.Reasons).Value(@person.ReasonId.ToString()))

All I have to do for the mvc drop down is the following:

@Html.DropDownListFor(m => person.Reason, Model.Reasons)

 

Should I do something different in the bind?

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 01 Nov 2017, 02:25 PM
Hello John,

The slower loading of the Kendo DropDownLists is caused by the fact that each Kendo DropDownList gets initialized with a script, which converts the respective <input> element (the elements, that you could initially observe as loaded) to a more complicated structure of DOM elements. This complicated structure is needed to apply the styling of the widget, but also to sustain its extended functionality.

The script initialization includes processing and rendering of numerous DOM elements on the page. This is a heavy browser operation, when the number of loaded widgets is around 300.

The default .NET DropDownList HTML helper, on the other hand, simply places <select> elements with <options> on the page. This compilation process from razor to HTML is executed entirely on the server, so no delay on the client would be observed.

Regards,
Veselin Tsvetanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
DropDownList
Asked by
John
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or