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

Add Node to tree bound to flat file

3 Answers 67 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Meerkat
Top achievements
Rank 1
Meerkat asked on 02 Aug 2010, 09:20 PM

Hello I am looking for an example that shows how to use RadTreeView that uses data from a flat database file

(NodeID,ParentID,NoteText)

 

After a lot of trial and error, I have managed to

  • Populate a TreeView using a web service to get the data.
  • Move Nodes around using Drag and Drop.
  • Edit Nodes.
  • Save all the changes back to the database. (probably not using the recommended method but it seems to work)

 

Unfortunately I find I am unable to add and delete Nodes.

The reason for this post is to ask if there is an example showing how this might be done.

 

I have found several examples on this site and elsewhere that show how it is done with unrealistic local data and that more often than not crash.

 

I think I read somewhere that you intended to provide means of persisting the Treeview back to the database. This will be most welcome if it ever materalises. but in the meantime I would really appreciate a hint of how to add and delete Nodes.

 

In my humble opinion, it would be a great idea to make available a working example that actually worked. I am sure you would greatly reduce the requests for help. On the other hand perhaps the reason there are no examples is because no one ever needs to do what I am trying to do. Anyway, just a suggestion :-)

 

 Many thanks in anticipation.

3 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 05 Aug 2010, 02:02 PM
Hi Meerkat,

I am attaching two projects to my reply.

One of the projects shows how to integrate the TreeView with RiaServices and LoadOnDemand. RiaServices manages the hierarchical relationship and if it is an option for you, I can suggest using it.

The second example contains a HierarchicalConverter that we created some time ago. It creates a hierarchy given an Id / ParentId and allows moving items by just changing these properties. Removing / adding items is as simple as adding / removing items from the original collection.

Hopefully the two examples will help you.

Kind regards,
Miroslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Meerkat
Top achievements
Rank 1
answered on 06 Aug 2010, 09:18 AM

Hello Miroslav,
Thank you for your interest in making suggestions on how your RadGridView might be used.

My project is finally working but I am sure there must be far better ways of doing things.

 


I was extremely interested in seeing the two projects you included but unfortunately I could not get either of them to run.

(Please see attached screen dumps which will hopefully give you a clue)

I am using version 2010.2.723.1040 and Silverlight 4.

 


Regards

 

0
Miroslav
Telerik team
answered on 11 Aug 2010, 02:52 PM
Hello Meerkat,

The LinqToSql project needs to be started from it web project. Of course you do not need to run it - have a look at the TreeView's code and comments, the ItemPrepared event handler for example.

I am attaching the DB that I used for this project as well.

The hierarchy converter is indeed missing files and this is because I included only its Silverlight version, forgetting that it in fact shares code with a WPF version as well - my mistake.

Again, you can find it attached.

Greetings,
Miroslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
Meerkat
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Meerkat
Top achievements
Rank 1
Share this question
or