StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



TreeView Data Binding GuidanceExpand / Collapse
Author
Message
Posted 10/23/2006 5:52:29 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 07/09/2007 2:48:58 PM
Posts: 57, Visits: 107
I have a BO something like this:

  • StrategyID
  • ParentStrategyID
  • Name
  • Description

Actually, I should say I will have a BO something like this, but anyway...would love to do one of two things with this data:

  1. Allow the user to select a particular node on the tree so I can grab the StrategyID from it.
  2. Allow the user to edit the tree in place.

I understand that #2 is more difficult than #1, and in fact just having an easy way to accomplish #1 would be great. #2 is not strictly necessary for my application, but would just be a nice-to-have.

By the way, I usually create a root node that has itself as its parent so that all the first-level nodes can have a real parent to point to and that way I don't have to deal with null parents and all that. But I'm open to suggestions on any of this...

Thanks!

Post #3826
Posted 10/24/2006 8:21:43 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
Generally, with treeviews, we build the tree manually by iterating through the business object(s) containing the data for the node.  We put the primary key or a NodeInfo structure (that contains the pk and a node type flag) in the Tag of each node that we place in the tree.  Then, we handle the AfterSelect event of the treeview and depending upon the node type flag in the structure in the tag, we process more information, like show a panel on the right that contains detailed information about the node.  As for editing in place, you will need to set the LabelEdit property to True and handle the BeforeLabelEdit (optional) and the AfterLabelEdit event to seek to the record in the business object and change the value.


www.bungie.net
Post #3831
Posted 11/15/2006 9:09:58 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 07/09/2007 2:48:58 PM
Posts: 57, Visits: 107
By the way, I just wanted to share that I ended up using a TreeList from Developer Express which had explicit support for a self-referencing table to implement a parent/child relationship and in-place editing.

I just used the SF BusinessBindingSource and set the tree's KeyFieldName and ParentFieldName values appropriately. Added the RootValue for a dummy root parent row and was basically done.

Very nice.

Post #4481
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 6:35am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.