Reading DataTable when I'm done with TreeView

3 posts, 1 answers
  1. Jafer
    Jafer avatar
    2 posts
    Member since:
    Aug 2014

    Posted 08 Sep 2014 Link to this post

    We're using the RadTreeView to show a hierarchical structure.

    Since our data does not follow the format required, (parentid, id, text), we are creating a datatable on the fly, adding values (and additional attributes) and binding. Now the user can add more information to the tree.

    When the user is done, we want to access all the data from the tree, convert it to our format and save it back to the database.

    The question is: can I access the datatable as it is? For every edit, I'm adding the required data to the datatable (using node attributes).

    If not, what is the best way to get all the data out and write it in my required format?

    Thanks in Advance.
  2. Jafer
    Jafer avatar
    2 posts
    Member since:
    Aug 2014

    Posted 08 Sep 2014 in reply to Jafer Link to this post

    Just to be specific. This is on the server side, in the CodeBehind in WebForms. C#
  3. DevCraft R3 2016 release webinar banner
  4. Answer
    Boyan Dimitrov
    Boyan Dimitrov avatar
    1728 posts

    Posted 11 Sep 2014 Link to this post


    Thank you for contacting Telerik Support.

    As far as I understand the user could change the information for some nodes or add new nodes to the RadTreeView (both on client or server-side) and you want at some point to save the RadTreeView data in your data base. In order to achieve such functionality I would suggest using the RadTreeView GetAllNodes() server-side method that will retrieve all nodes recursively in the hierarchy. Once you have a collection that contains RadTreeView nodes object you can simply iterate through each of those objects and save the information in your data base. 

    Please do not hesitate to contact us if you have any other questions.

    Boyan Dimitrov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top