This question is locked. New answers and comments are not allowed.
I have a editor template that looks like this:
<%@ Control Language=
"C#"
Inherits=
"System.Web.Mvc.ViewUserControl<string>"
%>
<%
IEnumerable<
string
> lCodes;
if
(ViewData[FactorStrings.ExchangeCodes]
is
IEnumerable<
string
>)
{
lCodes = (IEnumerable<
string
>)ViewData[FactorStrings.Codes];
}
else
{
lCodes =
new
List<
string
> { Model };
}
%>
<%= Html.Telerik().AutoComplete()
.Name(ViewData.TemplateInfo.GetFullHtmlFieldName(
string
.Empty))
.BindTo(lCodes)%>
My problem is that the control does not display the value (i.e. Model). This is somehow understandable since I don't tell it anywhere which value to display, but I also don't see an obvious way to do it (like .Value("something")) Is this a bug? I don't really want to do a hack like adding a html attribute with "value = Model" to show the value.
PS: Using AutoCompleteFor(...) directly in a view shows the value just fine.