I'm using the DataType Grid from uComponents (5.1.0) and trying to output the saved data into a razor macro for use on a front end template.
This is what's saved in the DB.
<productUses> <items> <item> <data alias="useTitle">Mobile surveys</data> <data alias="useDescription">This is some text about how you can use mobile surveys...</data> </item> </items> </productUses>
Is anyone able to point me in the right direction?
Thanks for your reply. I'm thinking that this should work, but having no luck.
This is the code of my macro:
@foreach (uComponents.DataTypes.DataTypeGrid.Model.StoredValueRow item in Model.productUses) { //code goes here }
And I'm getting the following error on my page "Error loading MacroEngine script" with the following debug trace.
Error Loading Razor Script (file: ) Object reference not set to an instance of an object. at uComponents.DataTypes.DataTypeGrid.DTG_ModelBinder.Init(Int32 CurrentNodeId, String PropertyData, Object& instance) at umbraco.MacroEngines.DynamicNode.TryCreateInstanceRazorDataTypeModel(Guid dataType, Type dataTypeType, String value, Object& result) at umbraco.MacroEngines.DynamicNode.TryGetMember(GetMemberBinder binder, Object& result) at CallSite.Target(Closure , CallSite , Object ) at ASP._Page_macroscripts_listproductuses_cshtml.Execute() in c:\umbraco\macroScripts\ListProductUses.cshtml:line 1 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.WebPages.WebPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage) at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
uComponents DataType Grid output in Razor
Hi there,
I'm using the DataType Grid from uComponents (5.1.0) and trying to output the saved data into a razor macro for use on a front end template.
This is what's saved in the DB.
<productUses>
<items>
<item>
<data alias="useTitle">Mobile surveys</data>
<data alias="useDescription">This is some text about how you can use mobile surveys...</data>
</item>
</items>
</productUses>
Is anyone able to point me in the right direction?
Thanks,
Christine
The uComponents documentation might give you a starting point:
http://ucomponents.codeplex.com/wikipage?title=DataTypeGridRazorSamples&referringTitle=MultipleDataTypeContainer
Hi,
Thanks for your reply. I'm thinking that this should work, but having no luck.
This is the code of my macro:
@foreach (uComponents.DataTypes.DataTypeGrid.Model.StoredValueRow item in Model.productUses)
{
//code goes here
}
And I'm getting the following error on my page "Error loading MacroEngine script" with the following debug trace.
at umbraco.MacroEngines.DynamicNode.TryCreateInstanceRazorDataTypeModel(Guid dataType, Type dataTypeType, String value, Object& result)
at umbraco.MacroEngines.DynamicNode.TryGetMember(GetMemberBinder binder, Object& result)
at CallSite.Target(Closure , CallSite , Object )
at ASP._Page_macroscripts_listproductuses_cshtml.Execute() in c:\umbraco\macroScripts\ListProductUses.cshtml:line 1
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
Any ideas?
Could you post the data stored in the grid?
Was there a solution to this?
I have an image and a textstring.
Why wouldn't the example in the Wiki work?
Why do you have to use the strongly typed option?
Anyways. Can someone help me out anyway.
I am using Umbraco 4.9 and uComponents 5.0
Thanks in advance.
I have a data type grid. I have a Media Picker and a text string to output.
Is there a way to get this to work. Thanks.
I am also having issues with the documentation on the Wki. Did anyone find a solution?
is working on a reply...