get child node count in transformation
*create a cs file called CSTransformation.cs under App_code folder, copy code below to that file
namespace CMS.Controls
{
public partial class CMSTransformation
{
public string ChildCount(object nodeId)
{
int nodeid = ValidationHelper.GetInteger(nodeId, 0);
string childCount = "";
if (!string.IsNullOrEmpty(nodeId.ToString()))
{
TreeProvider tp = new TreeProvider(SiteContext.CurrentUser);
TreeNode node = tp.SelectSingleNode(nodeid);
childCount = node.Children.Count().ToString();
}
return childCount;
}
}
}