Dynamic kendo dropdownlist datasource when editing row

2 posts, 0 answers
  1. lucerias
    lucerias avatar
    16 posts
    Member since:
    Nov 2011

    Posted 19 May 2016 Link to this post

    I have customer grid, when user double clicks the row, the custom pop up editor will be shown, there is drop down to show list interest but i need to remove the interest of current selected customer row from the viewdata by using interest id. 

    Customer Model:

        public class CustomerModel

            [Display(Name = "Customer ID")]
            public int CustomerID { get; set; }

            [Display(Name = "Interest ID")]
            public int InterestID { get; set; }




    @model int

         Html.Kendo().DropDownListFor(m => m)
                .DataValueField("InterestID ")
                .OptionLabel("Please select")

    Customer editor template

    <table class="popup-layout-tbl" style="display: table;">

    <tr id="trAppID">
                    <div class="k-edit-label popup-label">
                        @Html.LabelFor(model => model.CustomerID , new { @class = "popup-label-text" } )
                        @Html.TextBoxFor(model => model.CustomerID , new { @readonly = true, @class = "popup-input" })
                        @Html.ValidationMessageFor(model => model.CustomerID )

                    <div class="k-edit-label popup-label">
                        @Html.LabelFor(model => model.InterestID , new { @class = "popup-label-text" } )
                        @Html.EditorFor(model => model.InterestID , new { @class = "popup-input" })
                        @Html.ValidationMessageFor(model => model.InterestID  )





  2. Georgi Krustev
    Georgi Krustev avatar
    3724 posts

    Posted 23 May 2016 Link to this post


    If you would like to filter (reduce) the items in the DropDownList widget when in edit mode, then you will need to do the following things: This approach allows to remove of unwanted items from the data source.

    Note that the widget cannot select items that are not present in the source. If the item you would like to remove is selected, then it could be lost.

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top