I would like to allow a dropdownlist to show values that were previously selected but are now removed from the dropdownlist source. Instead of displaying blank. The dropdownlist is in a grid column.
Grid:
Template editor
So to explain in more detail: The CurrentCategory column is a text column (not an id column) and the user can select from a list of items found in the LookupCategory. However if an item is removed from the LookupCategory the value should still be displayed in instances where the user had already selected that value for the CurrentCategory.
Currently if a row contains a CurrentCategory value that is not in the LookupCategory list it is displayed as blank.
Perhaps I have to use a combobox instead?
Grid:
...
columns.ForeignKey(p => p.CurrentCategory, @Model.LookupCategory,
"CategoryName"
,
"CategoryName"
).Width(160);
...
Template editor
@
using
System.Collections
@(
Html.Kendo().DropDownListFor(m => m)
.BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName(
""
) +
"_Data"
])
.ValuePrimitive(
true
)
.AutoWidth(
true
)
)
So to explain in more detail: The CurrentCategory column is a text column (not an id column) and the user can select from a list of items found in the LookupCategory. However if an item is removed from the LookupCategory the value should still be displayed in instances where the user had already selected that value for the CurrentCategory.
Currently if a row contains a CurrentCategory value that is not in the LookupCategory list it is displayed as blank.
Perhaps I have to use a combobox instead?