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

Binding of dropdownlist which is in grid

1 Answer 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
saroj
Top achievements
Rank 1
saroj asked on 07 Jun 2013, 06:26 AM
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.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 11 Jun 2013, 07:39 AM
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!
Tags
Grid
Asked by
saroj
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or