Upgrades Questions on upgrading to version 6.x.
Version 6.x > Upgrades > After 5.5R2 > 6 Upgrade getting error : CMS.TreeEngine.TreeNode - DataRow View modes: 
User avatar
Member
Member
Darren - 12/19/2011 7:55:22 PM
   
After 5.5R2 > 6 Upgrade getting error : CMS.TreeEngine.TreeNode - DataRow
Getting the following error after upgrade:

'CMS.TreeEngine.TreeNode' does not contain a definition for 'DataRow' and no extension method 'DataRow' accepting a first argument of type 'CMS.TreeEngine.TreeNode' could be found (are you missing a using directive or an assembly reference?)

User avatar
Kentico Support
Kentico Support
kentico_janh - 12/20/2011 5:08:04 AM
   
RE:After 5.5R2 > 6 Upgrade getting error : CMS.TreeEngine.TreeNode - DataRow
Hello,

May I ask you, which method are you calling? There should be two constructor methods for a TreeNode in version 6 of Kentico CMS:

TreeNode(DataRow, String)

and

TreeNode(DataRow, String, TreeProvider)

where:

dataRow (DataRow)
- Datarow containing both tree node and coupled table
className (String)
- Class name in format application.class
treeProvider (TreeProvider)
- Tree provider used to access data

Please also follow the link below, which describes all changes in API for version 6:

http://devnet.kentico.com/Blogs/Martin-Hejtmanek/November-2011/Changes-in-the-API-from-version-Kentico-CMS-5-5-R2.aspx

Best regards,
Jan Hermann

User avatar
Member
Member
Darren - 12/20/2011 9:25:29 PM
   
RE:After 5.5R2 > 6 Upgrade getting error : CMS.TreeEngine.TreeNode - DataRow
<script runat="server" type="text/C#">
public void RightPanelNavigationZone_OnPreRender (Object sender, EventArgs e)
{
if (CMSContext.CurrentDocument.DataRow.Table.Columns.Contains("DisplayRightNavPanel"))
{
object o = CMSContext.CurrentDocument.DataRow["DisplayRightNavPanel"];
RightPanelNavigationZone.Visible = o is bool && (bool)o;
}
}
</script>

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 12/26/2011 5:22:09 PM
   
RE:After 5.5R2 > 6 Upgrade getting error : CMS.TreeEngine.TreeNode - DataRow
Hi,

could you please try to use:
object test = CMSContext.CurrentDocument["columnName"];

Best regards,
Ivana Tomanickova