Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Node Control Visibility  (Read 135 times)

0 Members and 1 Guest are viewing this topic.

Simon

  • Guest
Node Control Visibility
« on: January 19, 2012, 10:32:48 PM »
Hi,

I am just wondering the best way to handle node control visibility. I have seen in the sample you can show/hide a node control for a certain node liek so:
Code: [Select]
treeBuckets.NodeControlFilter[node, nsSeparator] = eNodeControlVisibility.Hidden;

however this seems cumbersome and ineffient.

My requirements are to show a control for a certain type of node. By default this node control should be hidden, and then depending on a value on my node derived class, show the control.

It appears there are certain ways to do this:

1. Handle the FilterNodeControl event
2. Set up an ObjectVisibilityManager

Could someone please enlighten me:

Code: [Select]
public class BucketNode:Node
{
public eType NodeType;
}

if i use this code, it doesnt seem to work:

Code: [Select]
private void treeBuckets_FilterNodeControl(FlexibleTreeView pTreeview, FilterNodeControlEventArgs pArgs)
        {
            //This event allows to customize what data is shown in each node control
            if (pArgs.Node is BucketNode)
            {
                BucketNode node = pArgs.Node as BucketNode;

                if (pArgs.NodeControl == nNumber)
                {
                    switch (node.NodeType)
                    {
                        case eBucketType.btBucket:
                        case eBucketType.btHeading:
                        case eBucketType.btMiscBucket:
                            pArgs.ControlVisibility = eNodeControlVisibility.Hidden;
                            break;
                        case eBucketType.btProject:
                            pArgs.ControlVisibility = eNodeControlVisibility.Visible;
                            break;
                    }
                }
            }
        }
« Last Edit: January 19, 2012, 10:35:15 PM by Simon »

Simon

  • Guest
Re: Node Control Visibility
« Reply #1 on: January 19, 2012, 10:39:32 PM »
Sorry, i couldnt see a way to delete the post -

it was simply setting Option.NodeContol.NodeControlFilterMode = Dynamic.

Ruslan

  • Flexible TreeView Team
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 569
Re: Node Control Visibility
« Reply #2 on: January 20, 2012, 12:58:34 AM »
Nice to hear that you resolved that. Please read this topic for more details.
 

Copyright © 2006-2012 ARMSoft. All rights reserved.