Load Balanced Name (VIP)
----- Server
---------- Indexes
There are multiple Server Objects and Index Objects. The VIP, Server, and Indexes are required to have there own ContextMenuStrip, as the actions are only similar to the node set.
The following is a portion of my code used to load the TreeView:
Code: Select all
foreach ($Server in $Servers)
{
$Name = $Server.Name
$Collections = $Server.Collection | Select Name -ExpandProperty Name
$SrvNodes = $treeview1.TopNode.Nodes.Add($Name)
Foreach ($Collection in $Collections)
{$ColNodes = $SrvNodes.Nodes.Add($Collection, $Collection, 0, 0)}
}
I attempted to use the following code to load a contextmenustrip for each of the nodes sets, doing this, all Nodes get the last contextmenustrip. This leads me to believe that this setting is global to the $Treeview1 Object, no matter where it is being set. Is this true?
Code: Select all
$treeview1.ContextMenuStrip = $Vse_Vip_Menu
$SrvNodes.ContextMenuStrip = $Vse_Server_Menu
$ColNodes.ContextMenuStrip = $Vse_Col_Menu
Is there a supported method to set a unique contextmenustrip based on the level of the node? I really was hoping that I dont have to do something hacky like using Click Actions with If and ElseIf's.
What does Sapien recommend for the approach on this?
Thanks,
AJ
Edit: If I create the create Tree List View manually I can using the Nodes Collection set a ContextMenuStrip for each one. I need to do this dynamiclly.
lambera2011-12-19 14:02:40