admin
-
3/5/2006 10:02:41 AM
Re: accessing parent object properties from child in transform...
Hello,
Thank you for your message. You can do that by defining your own function in the ProjectFunctions.cs/vb file and using it in the transformation. It will look like this:
static string GetParentValue(object aliasPath, string attributeName) { string parentNodePath = Functions.GetTreeProvider().SelectSingleNode(Convert.ToString(aliasPath), TreePathTypeEnum.AliasPath).GetParentPath(TreePathTypeEnum.AliasPath); TreeNode parentNode = Functions.GetTreeProvider().SelectSingleNode(parentNodePath, TreePathTypeEnum.AliasPath); return Convert.ToString(parentNode.GetValue(attributeName)); }
Then, you can use the function in your ascx transformation like
<%# ProjectFunctions.GetParentValue(DataBinder.Eval(Container, "DataItem.AliasPath")) %>
Please let me know if you need any help with that.
Best Regards,
|