kentico_vitaja wrote: Hi,
If your TreeNode is properly loaded by CMSContextCurrentDocument then you should be access your fields by GetValue() method. Here is simple example:
CMS.TreeEngine.TreeNode node = tree.SelectSingleNode(CMSContext.CurrentSite.SiteName, aliaspath, TreeProvider.ALL_CULTURES);
node.GetValue("myproperty");
Best regards,
Vita Janecek
We tried the following:
TreeNodeDataSet dataset = TreeHelper.SelectNodes("/%", true, "custom.course", "CourseID = " + courseID);
where courseID is a valid ID of a document of type custom.course.
When we expanded the "result view" in the debug mode we can see that the In the "DocumentName" and the "DocumentNamePath" values are also loaded properly.
But the "Items" property of the dataset is throwing an error:
"
base {System.SystemException} = {"Unable to cast object of type 'CMS.TreeEngine.TreeNodeCollection' to type 'CMS.TreeEngine.TreeNodeCollection`1[CMS.TreeEngine.TreeNode]'."}"
Any Idea what we might be doing wrong?