Use node.ChildrenAsTable() instead of node.Children. Column names of the datatable will hold the names of the documentproperties instead of the alias. Also multiple doctypes are not allowed. The first documenttype in the node will be used to fill the datatable. So if you have an FAQ type and a News type and FAQ is the first doctype in the node. Only Faq items will appear in the datatable. You can apply a filter by using the Overloaded method
how to populate Data table from node?
How can i chagne childrenNodes to datatable in following code snipet.
umbraco.presentation.nodeFactory.Node node = new umbraco.presentation.nodeFactory.Node(1071);
umbraco.presentation.nodeFactory.Nodes childrenNodes = node.Children;
further i want to use their properties also.
Please let me know how can i do that?
Thanks
JIgar
Use node.ChildrenAsTable() instead of node.Children. Column names of the datatable will hold the names of the documentproperties instead of the alias. Also multiple doctypes are not allowed. The first documenttype in the node will be used to fill the datatable. So if you have an FAQ type and a News type and FAQ is the first doctype in the node. Only Faq items will appear in the datatable. You can apply a filter by using the Overloaded method
For more info on the nodeFactory check http://umbraco.org/documentation/books/api-cheatsheet/working-with-the-nodefactory
Hope it helps you,
Richard
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.