c# - DropDownList in kendo grid control (by ClientTemplate) -


I need to create behavor for ClientTemplate like we have for EditorTemplateName. So I want to do something like this:

Template:

  @ (HTML.Cendo). Dropdown ListFor (M = & gt; Me). Bundo ( (Selectlist) ViewData ["ExamResults"]). Template ("#: value # #: text #") .DataTextField ("text") .DataValueField ("value") .Events (E => E.Change ( "examResultOnDropDownChange") Open ("Exam result on open"))   

and adding column to the grid: .EditorTemplateName ("ExamResultGridForeignKey")

But I want .ClientTemplate ("ExamResultGridForeignKey") or something like that (but it does not work):

  .ClientTemplate (Ht ("#: id = # id =") .bindto ((# # id #) .bindto ((Selection List) Data ["Exam Result"]). Template ("#: value # #: text #") .DefenseField (" Datewallfield ("value"))   

I do not need to make the field in editable mode with dropdown list (when we display values) editable dropdown list looks like.

In this way my dropdown list is being rendered. IsInForecast is a Bull field, if all else is doing then the correct DDL value should be (true / false), which is based on the value of the IsInForecast property. You are about to zoom it for your needs.

  columnss.Bound (m = & gt; m.IsInForecast). Title ("Forecasted") Customer Template ("# if (IsInForecast == true) {#" + "& lt; select id = '# = orderId #' onchange = save ('# = orderId #') style = 'width: 80px; Color: Select option ID = 'Yes' selected value = '1'> Yes & lt; option & gt; "+" option ID = 'no' value = '0' "+" & Lt; / option & gt; "+" & lt; / select & gt ;; '' width: 80px; color: 'navy' & gt; "+" #} and {# "+" & Lt; select id = '# = orderId #' onchange = save ('# = OrderId #'); style = 'width: 80px; + "& lt; option id =' yes' value = '1' & gt; Yes & lt; / option & gt; "+" & lt; option id = 'no' selected value = '0' & gt; not & lt; / option & gt; "+ "#} #");   

Where you ", which is setting the DDL ID field so that you know which dropdown list / record you are editing. onchange = save ('# = orderId #'); is calling a JS function that passes the Model Property Order ID method. You can now change it to get the right value of the correct DDL.

  save (order id) function {var ddl = # + orderId; Var getSelectedValue = $ (ddl) .val ();}   

This will provide a standard DDL. You can view the document here

  http://demos.telerik.com/kendo-ui/web/grid/editing-custom.html    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -