Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jigar 170 posts 233 karma points
    Jul 28, 2009 @ 10:43
    jigar
    0

    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

  • Richard Soeteman 4036 posts 12864 karma points MVP
    Jul 28, 2009 @ 11:03
    Richard Soeteman
    1

    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

     

Please Sign in or register to post replies

Write your reply to:

Draft