Has anyone had any luck getting Doc Type Grid Editor to work with Models Builder?
When I render my page I get this stack trace:
Umbraco.Web.Mvc.ModelBindingException: Cannot bind source content type Our.Umbraco.DocTypeGridEditor.Models.DetachedPublishedContent to model type Umbraco.Web.PublishedContentModels.DtgeLinkGrid.
at Umbraco.Web.Mvc.RenderModelBinder.ThrowModelBindingException(Boolean sourceContent, Boolean modelContent, Type sourceType, Type modelType)
at Umbraco.Web.Mvc.RenderModelBinder.BindModel(Object source, Type modelType, CultureInfo culture)
at Umbraco.Web.Mvc.UmbracoViewPage`1.SetViewData(ViewDataDictionary viewData)
at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)
at Our.Umbraco.DocTypeGridEditor.Web.Extensions.HtmlHelperExtensions.RenderDocTypeGridEditorItem(HtmlHelper helper, IPublishedContent content, String editorAlias, String viewPath, String previewViewPath)
at ASP._Page_app_plugins_doctypegrideditor_render_doctypegrideditor_cshtml.Execute() in c:\Workspaces\Web\App_Plugins\DocTypeGridEditor\Render\DocTypeGridEditor.cshtml:line 28
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)
at ASP._Page_Views_Partials_grid_editors_base_cshtml.Execute() in c:\Workspaces\Web\Views\Partials\Grid\Editors\Base.cshtml:line 20
public class GridViewPage<T> : UmbracoViewPage<IPublishedContent>
where T : IPublishedContent
{
private T _model;
protected new T Model => _model != null ? _model : (_model = (T) Activator.CreateInstance(typeof(T), base.Model));
public override void Execute()
{
}
}
Doc Type Grid Editor and Models Builder
Has anyone had any luck getting Doc Type Grid Editor to work with Models Builder?
When I render my page I get this stack trace:
I saw some quick fixes at https://github.com/umco/umbraco-doc-type-grid-editor/issues/44 but I can't seem to get them working.
My view:
What I did now as a workaround:
Since the constructor of the modelsbuilder modal needs IPublishedContent and the Model of DTGE is IPublishedContent it works lika a charm.
My workaround generic class:
In partial view:
This works great for me
is working on a reply...