This is a migrated thread and some comments may be shown as answers.

Reading DataTable when I'm done with TreeView

2 Answers 12 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jafer
Top achievements
Rank 1
Jafer asked on 08 Sep 2014, 11:55 AM
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 Answers, 1 is accepted

Sort by
0
Jafer
Top achievements
Rank 1
answered on 08 Sep 2014, 12:10 PM
Just to be specific. This is on the server side, in the CodeBehind in WebForms. C#
0
Accepted
Boyan Dimitrov
Telerik team
answered on 11 Sep 2014, 11:43 AM
Hello,

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.

Regards,
Boyan Dimitrov
Telerik
 

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.

 
Tags
TreeView
Asked by
Jafer
Top achievements
Rank 1
Answers by
Jafer
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or