Binding of dropdownlist which is in grid

2 posts, 0 answers
  1. saroj
    saroj avatar
    39 posts
    Member since:
    Oct 2011

    Posted 07 Jun 2013 Link to this post

    Dear Kendo Team,

    I'm using Kendo grid in my MVC Project in where i've a dropdown list.
    I want to bind the dropdown list on edit event of grid because it's not always common data for each row.

    with telerik I used to do like as follow:


    function onEdit_HireBookingInvoiceDetail(e) {
    $.ajax({
                    url: "@Url.Action("GetHireJobList", "Hire")",
                    data: {HireJobId: e.dataItem['HIRE_JOB_ID'] != null ? e.dataItem['HIRE_JOB_ID'] : 0},
                    dataType: "json",
                    type: "POST",           
                    success: function (myData){
                    $(e.form).find("#HireJob").data("tDropDownList").dataBind(myData);
                    $(e.form).find('#HireJob').data('tDropDownList').select(function (dataItem) {
                        return dataItem.Value == e.dataItem['HIRE_JOB_ID'];
                    });
                    
                    }
                }); 
    }
                   
    (where #HireJob is an editor template)

    i just want to transfer above code with kendo but i'm getting problem.

    can anyone please help me with this issue?

    Thanks in advance.
  2. Daniel
    Admin
    Daniel avatar
    2219 posts

    Posted 11 Jun 2013 Link to this post

    Hello,

    In Kendo you can set the new data with the widget dataSource data method e.g.

    $(e.form).find("#HireJob").data("kendoDropDownList").dataSource.data(myData);
    The select method can be used the same way. Regards,
    Daniel
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top