Get selected value when having label option

2 posts, 0 answers
  1. Dekel
    Dekel avatar
    25 posts
    Member since:
    Jan 2015

    Posted 12 Jun 2015 Link to this post

    I'm using Kendo().DropDownList() with OptionLabel configured.

    When trying to get selected item Text / Value, I'm getting incorrect values.

    for example if I choose the first drop down option I'm getting the value of the option label.

    if I choose the second option I'm getting the values of the first option.


                .OptionLabel("Select Subject")
                .Events(events =>


    onSelect = function (e) {
        var dataItem = this.dataItem(e.item.index());

         // or even

        var selectedValue = this.value()

        var selectedText = this.text()



    How can I get the correct selected value (Text / Value) ?


    Thank you.


  2. Plamen Lazarov
    Plamen Lazarov avatar
    135 posts

    Posted 15 Jun 2015 Link to this post

    Hello Dekel,


    Due to a change in the DropDownList rendering the optionLabel is moved outside the items list and placed as a static header on top of the popup element. Since option label element and list items are positioned in different containers the jQuery index method might cause an incorrect behavior. 


    To make it work use the code snippet below without the .index() method: 


    var item = this.dataItem(e.item);

    Please find below a sample demo illustrating this approach.



    Plamen Lazarov


    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top