kendoDropDownList json datasource

if you want to load your kendoDropDownList  from json we service you can follow this

script

  $('#Branchs').kendoDropDownList({  
                       // optionLabel: "Select branch...",  
                       dataTextField: "text",  
                       dataValueField: "value",  
                       change: function () {  
                         e.model.BranchRef = this.text();  
                       },  
                       dataSource: {  
                         transport: {  
                           read: function (e) {  
                             $.ajax({  
                               url: 'http://localhost/Notifier/Branches/GetDropDown/token',  
                               type: 'GET',  
                               dataType: 'json',  
                               success: function (data) {  
                                 {  
                                   e.success(data);  
                                 }  
                               },  
                             });  
                           }  
                         }  
                       }  
                     });  

service call

  [HttpGet]  
     [Route("GetAll/{SecurityToken}")]  
     public HttpResponseMessage GetAllBranches(string SecurityToken)  
     {  
       
       List<BranchDTO> Branches = BranchService.GetAllBranchDTO(database, false);  
       return Request.CreateResponse<List<BranchDTO>>(HttpStatusCode.OK, Branches);  
     }  


Popular posts from this blog

WPF Crystal Report Viewer Using SAP

mvc razor textboxfor change event change another textboxfor value

ASP.NET MVC razor SAP Crystal report