Pass (Send) parameters to kendoDropDownList in ASP.Net MVC

Last Reply 8 days ago By dharmendr

Posted 8 days ago

hi,

I want to pass parameters to kendo dropdown ,basic code like below

    Search Textbox:   @(Html.Kendo().TextBoxFor(x=>x.BARCODE)
                      .Name("BARCODE")                                
                      .HtmlAttributes(new { @class = "ml-2 p-0", style = "width:100px" }))
 
    Grid Column:columns.Bound(p => p.ITEMCODE).EditorTemplateName("Dropdown").Width(130);
 
    Template: @(Html.Kendo().DropDownListFor(m => m)
        .Name("ITEMCODE")
        .Filter(FilterType.StartsWith)
        .MinLength(2)
        .HtmlAttributes(new {style = "font-size:10px" })
    )
			
    $("#ITEMCODE").kendoDropDownList({           
        serverFiltering: true,
        dataTextField: "Text",
        dataValueField: "Value",
        filter: "startswith",
        dataSource: {
            transport: {
                read: {
                    url:"Orders/GetData"
                }
            }
        }
    });
			
			
    Search Function:   $("#BARCODE").change(function() {
        var grid = $("#grid").data("kendoGrid");
        grid.addRow();              
        var dropDDL = $("#ITEMCODE").data("kendoDropDownList");
        dropDDL.dataSource.read()
        dropDDL.search="APPLE";
        dropDDL.open();
    });