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")]
[UIHint("InterestDropDown")]
public int InterestID { get; set; }
}
InterestDropDown.cshtml
@model int
@(
Html.Kendo().DropDownListFor(m => m)
.BindTo((System.Collections.IEnumerable)ViewBag.InterestList)
.DataValueField("InterestID ")
.DataTextField("InterestName")
.OptionLabel("Please select")
)
Customer editor template
<table class="popup-layout-tbl" style="display: table;">
<tbody>
<tr id="trAppID">
<td>
<div class="k-edit-label popup-label">
@Html.LabelFor(model => model.CustomerID , new { @class = "popup-label-text" } )
</div>
<div>
@Html.TextBoxFor(model => model.CustomerID , new { @readonly = true, @class = "popup-input" })
@Html.ValidationMessageFor(model => model.CustomerID )
</div>
</td>
</tr>
<tr>
<td>
<div class="k-edit-label popup-label">
@Html.LabelFor(model => model.InterestID , new { @class = "popup-label-text" } )
</div>
<div>
@Html.EditorFor(model => model.InterestID , new { @class = "popup-input" })
@Html.ValidationMessageFor(model => model.InterestID )
</div>
</td>
</tr>
</tbody>
</table>
Thanks.