treeView child restrictions
-
I want to display the node text after selection in a label. However i need to restrict this display to only the 3rd-child node in the list so in other words,
CompanyName
DeptName
-
UserName
-
UserPC
UserPhone#-
Dept1Name
**User1Name** - User1PC User1Phone#
I want to restrict the display of name to only the username, user1name, user2name, etc. nodes, and it needs to stay until the next user name is selected... Once i figure out the restriction portion i'll beable to set the label text static until the next username selection... just would like some assitance with the setting of the node restriction. any ideas? string Beautiful; Beautiful = "ignorant"; label1.Text = "The world is full of " + Beautiful +" people."; Why is common sense such an un-common comodity?
-
-
I want to display the node text after selection in a label. However i need to restrict this display to only the 3rd-child node in the list so in other words,
CompanyName
DeptName
-
UserName
-
UserPC
UserPhone#-
Dept1Name
**User1Name** - User1PC User1Phone#
I want to restrict the display of name to only the username, user1name, user2name, etc. nodes, and it needs to stay until the next user name is selected... Once i figure out the restriction portion i'll beable to set the label text static until the next username selection... just would like some assitance with the setting of the node restriction. any ideas? string Beautiful; Beautiful = "ignorant"; label1.Text = "The world is full of " + Beautiful +" people."; Why is common sense such an un-common comodity?
I'm guessing that everyone was gone for the holidays, So i'm hopping that by adding to this thread will give it some more visiblity...... Help!!!!! string Beautiful; Beautiful = "ignorant"; label1.Text = "The world is full of " + Beautiful +" people."; Why is common sense such an un-common comodity?
-
-
I want to display the node text after selection in a label. However i need to restrict this display to only the 3rd-child node in the list so in other words,
CompanyName
DeptName
-
UserName
-
UserPC
UserPhone#-
Dept1Name
**User1Name** - User1PC User1Phone#
I want to restrict the display of name to only the username, user1name, user2name, etc. nodes, and it needs to stay until the next user name is selected... Once i figure out the restriction portion i'll beable to set the label text static until the next username selection... just would like some assitance with the setting of the node restriction. any ideas? string Beautiful; Beautiful = "ignorant"; label1.Text = "The world is full of " + Beautiful +" people."; Why is common sense such an un-common comodity?
Easy. Each Node has a Tag property. Just set the Tag property to some value that signifies it as a displayable node.
TreeNode newNode = new TreeNode(); // Set Tag to 0 for a NON-Displayable node newNode.Tag = 0;
// Set the Tag to 1 for a Displayable node
newNode.Tag = 1;When the user selects a node, check its Tag property to see if it should be displayed in your label. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
-
Easy. Each Node has a Tag property. Just set the Tag property to some value that signifies it as a displayable node.
TreeNode newNode = new TreeNode(); // Set Tag to 0 for a NON-Displayable node newNode.Tag = 0;
// Set the Tag to 1 for a Displayable node
newNode.Tag = 1;When the user selects a node, check its Tag property to see if it should be displayed in your label. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
hmm, good catch... but, can't do it all of my nodes (save the root) are loaded by the dataReader, so i am currently loading the node text and tag from the db so i can't edit the tag value unless i create a tag_value coulumn on the db... where i could set the usernames as 1 and all others as 0 unless someone else has a better idea / plan. string Beautiful; Beautiful = "ignorant"; label1.Text = "The world is full of " + Beautiful +" people."; Why is common sense such an un-common comodity?
-
Easy. Each Node has a Tag property. Just set the Tag property to some value that signifies it as a displayable node.
TreeNode newNode = new TreeNode(); // Set Tag to 0 for a NON-Displayable node newNode.Tag = 0;
// Set the Tag to 1 for a Displayable node
newNode.Tag = 1;When the user selects a node, check its Tag property to see if it should be displayed in your label. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
was thinking about this some more... since the Tag property is of type: object i can pretty much do whatever i want with it, the question just becomes what is the best thing to do? or is simply going with a primative(so-to-speak) 0 or 1 value the best option? :confused: string Beautiful; Beautiful = "ignorant"; label1.Text = "The world is full of " + Beautiful +" people."; Why is common sense such an un-common comodity?
-
I want to display the node text after selection in a label. However i need to restrict this display to only the 3rd-child node in the list so in other words,
CompanyName
DeptName
-
UserName
-
UserPC
UserPhone#-
Dept1Name
**User1Name** - User1PC User1Phone#
I want to restrict the display of name to only the username, user1name, user2name, etc. nodes, and it needs to stay until the next user name is selected... Once i figure out the restriction portion i'll beable to set the label text static until the next username selection... just would like some assitance with the setting of the node restriction. any ideas? string Beautiful; Beautiful = "ignorant"; label1.Text = "The world is full of " + Beautiful +" people."; Why is common sense such an un-common comodity?
If you want to determine if a specific treenode level, you can use this... int treeNodeLevel=1; TreeNode tn = treenodeToBeTested; while (tn.Parent != null) { tn = tn.Parent; treeNodeLevel++; } You can then say... if (treeNodeLevel == 3) { ...do whatever } Darryl Borden Principal IT Analyst dborden@eprod.com
-
-
If you want to determine if a specific treenode level, you can use this... int treeNodeLevel=1; TreeNode tn = treenodeToBeTested; while (tn.Parent != null) { tn = tn.Parent; treeNodeLevel++; } You can then say... if (treeNodeLevel == 3) { ...do whatever } Darryl Borden Principal IT Analyst dborden@eprod.com
Thanks, I'll have to check this out...as i'm not at a point right now to test it...but i will post the results of my testing shortly string Beautiful; Beautiful = "ignorant"; label1.Text = "The world is full of " + Beautiful +" people."; Why is common sense such an un-common comodity?
-
If you want to determine if a specific treenode level, you can use this... int treeNodeLevel=1; TreeNode tn = treenodeToBeTested; while (tn.Parent != null) { tn = tn.Parent; treeNodeLevel++; } You can then say... if (treeNodeLevel == 3) { ...do whatever } Darryl Borden Principal IT Analyst dborden@eprod.com
Works like a champ! --had to do a little bit of modification as you had the nodelevel declared as a 1 so it would then increment to 4 before ever actually reaching the desired point...so mod it to a 0 rather than 1 and its pretty...course i could have just changed the if == to value to 4, but then it would not have been the soulution i was looking :-D Thanks a bunch! string Beautiful; Beautiful = "ignorant"; label1.Text = "The world is full of " + Beautiful +" people."; Why is common sense such an un-common comodity?