S
strangermike1
Guest
Hello, I have a tree structure that looks something like this:
+ Vacation
....Used
.........UsedInMonth
.....Not Used
+ Personal
......Used
..........UsedInMonth
......Not Used
+ SickTime
.....Used
.....Not Used
How can I determine the parent/base node? If the user clicks UsedInMonth under the 'Personal' parent how do I capture the parent node text "Personal"?
Or if I clicked Used in 'Vacation', how do I capture 'Vacation' as my Parent node?
How can I get the correct parent node name when clicking inside the different parent/child tree?
Thanks
This was an answer presented for a web form, I tried without success modifying for Window form. Perhaps you may have done something similar?
(although this is C#, I am coding in vb.net, I tried to translate, but could not side step different errors and could not get the SelectedNodeChange to fire)
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
if (TreeView1.SelectedNode.Parent.Text == "Vacation")
{
if (TreeView1.SelectedNode.Text == "UsedInMonth")
{
Response.Write("This is Vacation's UsedInMonth");
}
}
else if (TreeView1.SelectedNode.Parent.Text == "Personal")
{
if (TreeView1.SelectedNode.Text == "UsedInMonth")
{
Response.Write("This is Personal's UsedInMonth");
}
}
}
Continue reading...
+ Vacation
....Used
.........UsedInMonth
.....Not Used
+ Personal
......Used
..........UsedInMonth
......Not Used
+ SickTime
.....Used
.....Not Used
How can I determine the parent/base node? If the user clicks UsedInMonth under the 'Personal' parent how do I capture the parent node text "Personal"?
Or if I clicked Used in 'Vacation', how do I capture 'Vacation' as my Parent node?
How can I get the correct parent node name when clicking inside the different parent/child tree?
Thanks
This was an answer presented for a web form, I tried without success modifying for Window form. Perhaps you may have done something similar?
(although this is C#, I am coding in vb.net, I tried to translate, but could not side step different errors and could not get the SelectedNodeChange to fire)
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
if (TreeView1.SelectedNode.Parent.Text == "Vacation")
{
if (TreeView1.SelectedNode.Text == "UsedInMonth")
{
Response.Write("This is Vacation's UsedInMonth");
}
}
else if (TreeView1.SelectedNode.Parent.Text == "Personal")
{
if (TreeView1.SelectedNode.Text == "UsedInMonth")
{
Response.Write("This is Personal's UsedInMonth");
}
}
}
Continue reading...