i use this way @Html.GetGridHtml(Model, "propertyAlias")
but i get an error
Umbraco.Web.Mvc.ModelBindingException: Cannot bind source type Umbraco.Web.PublishedModels.Slider to model type Umbraco.Core.Models.PublishedContent.IPublishedContent.
Did you name your DocType's property alias -> propertyAlias?? In my docType I called it mainGridContent - not propertyAlias. Which would explain why it cannot bind to the grid editor.
Umbraco Doc type grid layout error
Hello i fallow this tutorial in the the umbraco 8 https://papermoon.io/blog/creating-a-slider-in-umbraco/ but i do not know how add the grid to my template
@Html.GetGridHtml(Model, "propertyAlias")
i use this way @Html.GetGridHtml(Model, "propertyAlias") but i get an error Umbraco.Web.Mvc.ModelBindingException: Cannot bind source type Umbraco.Web.PublishedModels.Slider to model type Umbraco.Core.Models.PublishedContent.IPublishedContent.
Hi Ali,
Not sure if I can help but...
Did you name your DocType's property alias -> propertyAlias?? In my docType I called it mainGridContent - not propertyAlias. Which would explain why it cannot bind to the grid editor.
Also, I do not use the default grid editor (Bootstrap3.cshtml) found in Views\Partials\Grid. I created my own which is why I have a 3rd parameter.
You can try with the default...
Hope this helps.
Daniel
@Html.GetGridHtml(Model, "myGrid")
No this how i use it
Hmmm...
Ok, the only other difference that I can think off is...
at the top of your parial view did you try adding...
This would be the DocType model.
If that still doesn't work, you could try adding the additional parameter...
or if you want the bootstrap3 fluid optoin, then specify that one...
Daniel
Thank you but i change my partial to this @inherits Umbraco.Web.Mvc.UmbracoViewPage
So it still does not work??
Because your original posted error was...
Cannot bind source type Umbraco.Web.PublishedModels.Slider
Are you developing directly in Umbraco or do you use Visual Studio or another editor/IDE?
Cheers Daniel
NO it is working now thanks after changing my partial
is working on a reply...