API Questions on Kentico API.
Version 6.x > API > Get node or value from URL Selector View modes: 
User avatar
Member
Member
mswift1974-gmail - 9/7/2012 12:37:56 PM
   
Get node or value from URL Selector
I get a treenode using CMS.CMSHelper.TreeHelper.SelectSingleNode
That node/document has a field that is 'Form Control Type' Selection and Form Control - URL Selector

How do I get the value or node from that field. I tried using GetValue("ColumnName") on the treenode, but that resulted in NULL.


User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 9/7/2012 2:50:03 PM
   
RE:Get node or value from URL Selector
You need to specify the ClassName parameter or the SelectSingleNode method only returns the default columns of a TreeNode.

User avatar
Member
Member
mswift1974-gmail - 9/7/2012 3:12:46 PM
   
RE:Get node or value from URL Selector
Thanks I got it working, it was actually a type that caused my problems. But here is the big problem

The node I get has three Url Selection fields. I can get a node from each field, I put those values into a TreeNodeDataSet. I want to use the TreeNodeDataSet as the datasource for a tab menu. I set the datasource in the normal way: cmsTabMenu.DataSource = treeNodeDataSet. BUt when the page runs the datasource is empty. Why? I can set a break point and I see items in the TreeNodeDataSet.

Is there a helper method that converts the TreeNodeDataSet into an acceptable datasource type?

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 9/11/2012 6:46:44 AM
   
RE:Get node or value from URL Selector
Hi,

In the Kentico CMS API Documentation you can find that the TreeNodeDataSet Class has the .Tables Property - Gets the collection of tables contained in the DataSet. This will output data from DataSet in a Table format.

But expected behaviour is that the DataSet is set with the DataSource data not reversed.
See article: Mapping Data Source Tables to Dataset Tables