Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Bound nodes under unbound nodes  (Read 146 times)

0 Members and 1 Guest are viewing this topic.

Simon

  • Guest
Bound nodes under unbound nodes
« on: January 18, 2012, 11:21:00 AM »
I was wondering, if its possible to create some parent nodes in the tree, and then for all the sub-nodes of the parent, bind them to a datatable/IBindingList?

So, for example:

Parent (unbound)
-Child1 (bound)
-Child2 (bound)
Parent2 (unbound)
...etc

Ruslan

  • Flexible TreeView Team
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 569
Re: Bound nodes under unbound nodes
« Reply #1 on: January 18, 2012, 03:37:29 PM »
If your data source doesn`t contain root rows but only children then no, Flexible TreeView doesn`t support this. But if your data source contains root rows but you want disable update them from the tree and enable edit only children rows then this`s possible.
Please describe your situation.

Simon

  • Guest
Re: Bound nodes under unbound nodes
« Reply #2 on: January 18, 2012, 10:17:54 PM »
Thanks for the quick response.

Ive actually decided against my original thinking, opting to populate the treeview manually from the database. This way it gives me more flexibility.

On an unrelated topic, i would like to know, is if there is any event for a NodeControl (NodeTextBox) that provides the following functionality:

Code: [Select]
string GetNodeText(object sender, NodeDataObject Data)
{
 //provide conditional formatting for the TextControl
  NodeEx node = (NodeEx)Data;
  switch(node.Type)
{
  case 1:return node.Property1;
  case 2:return node.Property2;
etc...
}
}

Ruslan

  • Flexible TreeView Team
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 569
Re: Bound nodes under unbound nodes
« Reply #3 on: January 19, 2012, 01:14:34 AM »
That`s called node control virtual mode. Please read this topic ('Virtual data mode' section) for details. You need to enable the nodeControl.VirtulMode bool property, subscribe to the treeview NodeControlValueGet event and return node control value from there according to the pArgs.Node value.

Simon

  • Guest
Re: Bound nodes under unbound nodes
« Reply #4 on: January 19, 2012, 03:27:31 AM »
Wonderful.

I must say as i am getting deeper and deeper i am liking it more and more.
The only thing i could complain about (and im being picky here) is the lack of a simple "getting started" sample project (as I have seen from another post on here and i know your working on it).
I can see the sample provided is really comprehensive, but the main drawback i feel is the inheritance and interfacing throughout it, which subtracts from the novice new user -it took me a while to simply add nodes and show text coming from the standard treeview.

But, to cancel that out the feature list is superb, and i must say im sure there is a way to do pratically anything with Flexible Treeview.

Thanks again for the prompt reply.

Ruslan

  • Flexible TreeView Team
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 569
Re: Bound nodes under unbound nodes
« Reply #5 on: January 19, 2012, 04:40:01 AM »
Thank you for your feedback.
We`re working on easy to understand and simple sample projects for newbies. Until they will be available please post your questions here and we`ll try to do our best to help you with your issues.
 

Copyright © 2006-2012 ARMSoft. All rights reserved.