This question is locked. New answers and comments are not allowed.
Hi, in my grid, I have a column template that I want to put an autocomplete in. I have to use a template because I need to represent dynamic columns that are figured out at run-time and .bound() doesn't bind to anything but properties and fields (whereas this is in a IEnumerable).
My code looks like this for that part of the grid; irrelevant parts taken out:
foreach (...)
I get an error:
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: key
And this occurs at at
I'm not sure what the key parameter is. Is this even possible? I've only seen people do this in an EditorTemplate, however that would require quite a bit of a workaround for all the information that I need to use in the template.
My code looks like this for that part of the grid; irrelevant parts taken out:
foreach (...)
{
...
columns.Template(
@<div style="width:100px;">
@{
string value = ...;
string keyName = ...;
string valueName = ...;
}
<input id="@keyName" name="@keyName" type="hidden" value="@..." />
<input style="width:inherit" id="@valueName" name="@valueName" value="@value" />
@Html.Telerik().AutoComplete().
.Name(@valueName)
.DataBinding(binding => binding.Ajax().Select("AutoCompleteAjaxLoading", "...", new { ... }))
.AutoFill(true)
.HighlightFirstMatch(true)
.Filterable(filtering => filtering.FilterMode(AutoCompleteFilterMode.StartsWith));
@{
...
}
</div>
).Title(...).Width(100);
}
I get an error:
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: key
And this occurs at at
@Html.Telerik().AutoComplete().
I'm not sure what the key parameter is. Is this even possible? I've only seen people do this in an EditorTemplate, however that would require quite a bit of a workaround for all the information that I need to use in the template.