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

DropDownListForin Custom Editor not selecting optionLabel

2 Answers 132 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 29 Mar 2017, 05:33 PM
I have an MVC KendoGrid with a custom popup editor that contains 3 select lists using razor DropDownListFor html helpers.  I am using the optionLabel parameter on the helper to show "-- Select One --" empty option when creating a new record, but it is not being selected for 2 selects that have integer values. The other select that has a string type for value in the model is showing the "-- Select One --" corrrectly.  Is there something I can do to have it selected in all 3 dropdown lists for new records?

2 Answers, 1 is accepted

Sort by
0
Sam
Top achievements
Rank 1
answered on 30 Mar 2017, 01:13 PM
Also, when I take the form outside of the grid custom editor template and put it in a view of its own and supply the same model, the dropdown lists behave as expected selecting the 0 index for all 3 dropdown lists
0
Pavlina
Telerik team
answered on 31 Mar 2017, 04:51 PM
Hi,

Please refer to the forum threads below where a similar question is disscused: 
http://www.telerik.com/forums/inline-add---not-getting-dropdown-default-value#XZ4azeBieU29g-Wg2JXU9A
http://www.telerik.com/forums/grid-add-edit-popup-not-defaulting-dropdown

Give the suggestions there a try and let us know in case you need additional assistance.

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