Hi!
I am wondering if something like this is possible:
I have an Html.EJ().Grid<object>
...
I want to dynamically map columns from partial view
Something like (?)
.Columns(col =>
{
col.Field("Id").HeaderText("Id").IsPrimaryKey(true).Visible(false).Add();
col.Field("Order").HeaderText(FormsResources.Order).Priority(1).Add();
************ HERE I WANT TO INJECT ADDITIONAL COLUMNS **********
col.Field("Label").HeaderText(FormsResources.Label).Priority(2).Add();
}
I thought about something like
Html.RenderPartial("_PartialWhatever", new ViewDataDictionary(new
{
ResourceTypeId = Model.Id,
Columns = col
}));
but it doesn't work.
TL;DR; I want to access the col object from the parent view in my _PartialWhatever view
Thanks ;)