This question is locked. New answers and comments are not allowed.
Hello,
I have tried to nest dropdowns in a grid.
My model contains an Ilist with in it some data and and another Ilist.
So for each row there is an Ilist to fill the dropdown.
Then I have an IList in my model in which I would like to contain a result list of all the selected items in all the dropdowns.
It works fine to display it but I cannot get the result list to connect to the dropdowns.
I have tried it with the code below, but I am lacking an Index for my result list.
<% Html.Telerik().Grid<DBCOnderhoud.Vis.ServiceProxy.CompleteTableVersionExport>(Model.CompleteTableVersionExports)
.Name(
"TableVersionsGrid"
)
.Columns(columns =>
{
columns.Bound(o => o.TableProjectTableDefinition.TableDefinitionId.TableNameId.TableNameId).Hidden(
true
);
columns.Bound(o => o.TableProjectTableDefinition.TableDefinitionId.TableNameId.Name);
columns.Bound(o => o.TableProjectTableDefinition.IsForExport);
columns.Bound(o => o.TableProjectTableDefinition.NewTableVersionRequired);
columns.Bound(o => o.TableProjectTableDefinition.TableDefinitionId.TableNameId.TableTypeId.TableTypeName);
columns.Template(c => {%>
<%
Html.Telerik().DropDownListFor(model => model.TableVersionInExport[THIS_IS_WHERE_I_WANT_AN_INDEX].TableVersion.TableVersionId)
.Name(
"TableVersion_"
+ c.TableProjectTableDefinition.TableDefinitionId.TableNameId.TableNameId)
.BindTo(
new
SelectList(
c.TableVersions,
"TableVersionId"
,
"Version"
)
)
.HtmlAttributes(
new
{ style =
"font-size:11px;"
})
.DropDownHtmlAttributes(
new
{ style =
"font-size:11px;"
})
.Render();
%>
<%
});
})
.DataKeys(keys => keys.Add(c => c.TableProjectTableDefinition.TableDefinitionId.TableNameId.TableNameId))
.Scrollable(c => c.Height(
"450px"
))
.Selectable()
.Sortable()
.Footer(
false
)
.Render();
%>
Any help would be appreciated.
Best regards,
Mark Berghaan