read value of other columns in a customized Combo Template

2 posts, 0 answers
  1. John
    John avatar
    1 posts
    Member since:
    May 2014

    Posted 20 Nov 2014 Link to this post

    Hi is it possible to read an entire rows data with a customized template on a combo box rather than just use dataValueField? I would like to return both the Key and Date values in the example below

    @(Html.Kendo().DropDownListFor(m => m)
        .Events(e => e.Change("ReceiptPayments.invoices.change"))
        <div id="Header">
                <span class="col-sm-2">Number</span>
                <span class="col-sm-4">Date</span>

        <div class="row" id="Template">
            <span class="col-sm-2">#: data.Key #</span>
            <span class="col-sm-4">#: data.Date #</span>

  2. Georgi Krustev
    Georgi Krustev avatar
    3687 posts

    Posted 24 Nov 2014 Link to this post

    Hello John,

    I answered to the other ticket opened on the same subject. I would like to ask you continue our discussion there to avoid any duplication. Thank you for the understanding.

    Here is a quote of the answer:

    In general, the DropDownList is design to post its selected value defined by dataValueField option. It behaves just like every HTML input element. If you would like to send more information to the server, then you will need to get the selected data item. Use the dataItem method for this task:
    var widget = $("#[widget id").data("kendoDropDownList");
    var dataItem = widget.dataItem();
    From here, you can send the data item using Ajax or posting with regular Html form element is required, then you will need to generate the required HTML input elements in order to post the additional data.

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