Evaluation support > Evaluation Questions
Node Control Visibility
(1/1)
Simon:
[Edit]
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;
}
}
}
}
<<<<
Simon:
[Edit]
Sorry, i couldnt see a way to delete the post -
it was simply setting Option.NodeContol.NodeControlFilterMode = Dynamic.
Ruslan:
Nice to hear that you resolved that. Please read this topic for more details.
Navigation
[0] Message Index