I have a custom grid view which uses renderRow helper similarily to Urvish post here https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/64536-How-to-use-grids-with-views-and-maybe-controls-to-make-it-look-good
I'm trying to pass grid settings to grid partial panels by using TempData but the TempData is getting null both to my PartialViewMacroPageExtensions class and the macro partial view itself.
@foreach (var control in area.controls) {
if (control != null && control.editor != null && control.editor.view != null) {
TempData["grid-settings"] = area.config;
<text>@Html.Partial("grid/editors/base", (object)control)</text>
}
}
public static class PartialViewMacroPageExtensions
{
public static T GetGridProperties<T>(this PartialViewMacroPage page)
where T : new()
{
if (page.TempData["grid-settings"] != null)
{
return JsonConvert.DeserializeObject<T>(page.TempData["grid-settings"].ToString());
}
return new T();
}
}
Is there any way to pass grid element settings to it's partial view?