Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Why SelectedIndex(2) always return the 0 index value on the dropdownlist

$
0
0
Hello Phillip,

The described behavior is actually expected, because the widget will ignore the SelectedIndex option if value is defined, which is exactly the case when DropDownListFor extension is used. Basically, the DropDownListFor method will retrieve the name and value from the specified model. Hence it will use the model value instead of the index, because the defined value has a higher priority (check the attached project for better understanding).

If you would like to select a specific item, you will need to set the proper item value. 

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>