 |
|
|
 |
|
 |
Every one talk how they generate a treeView from an XML file usin the TreeNodeSrc property. I still can't do it.
Im usin this code.
private void setupEmployees()
{
TreeNode tn = new TreeNode();
tn = new TreeNode();
tn.TreeNodeSrc ="state_city.xml";
TreeView1.Nodes.Add(tn);
}
can any one help?
Luis Fernando Forero G.
|
|
|
|
 |
|
 |
Hi, current I'm working on a C# web application, in this app, I need to use treeview to display multiple choice for reports, when user clicks a tree note, a Crytal report will show up( in a popup window, use javascript window.open()), every thing works fine, except this popup window has lost focus( it only shows in the front for a couple secods )at some point. Please advice.
thanks,
Mindy
|
|
|
|
 |
|
 |
i am using the Microsoft.Web.UI.WebControls.TreeView that is in the IEControls
it show root node and child node in designer fine
but when i run it render the all nodes in one line . i use the static nodes
Waiting for help
|
|
|
|
 |
|
 |
Hello are you using IE or Netscape? I have only tested this control in IE.
|
|
|
|
 |
|
 |
I will test it on Internet Explorer
i need folow the step by step tutorial
but it will show all nodes in one line no images kindly send me sample for static nodes
Thanx Waiting
|
|
|
|
 |
|
 |
Hello here is a sample of adding static nodes. First make sure you also add this import:
Imports Microsoft.Web.UI.WebControls
Here is a sample that will add two departments with two employees.
Private Sub setupEmployees()
Dim tn As New TreeNode()
Dim tnChild As New TreeNode()
' Add static elements
' First lets add the accounting department
tn = New TreeNode()
tn.Text = "Accounting"
' next add an employee
tnChild = New TreeNode()
tnChild.Type = "Employee"
tnChild.Text = "Bob Smith"
tn.Nodes.Add(tnChild)
' next add another employee
tnChild = New TreeNode()
tnChild.Type = "Employee"
tnChild.Text = "Joe Smoe"
tn.Nodes.Add(tnChild)
' Add this department to the treeview
TreeView1.Nodes.Add(tn)
' Second lets add the personnel department
tn = New TreeNode()
tn.Text = "Personnel"
' next add an employee
tnChild = New TreeNode()
tnChild.Type = "Employee"
tnChild.Text = "Albert Boz"
tn.Nodes.Add(tnChild)
' next add another employee
tnChild = New TreeNode()
tnChild.Type = "Employee"
tnChild.Text = "Fred Anderson"
tn.Nodes.Add(tnChild)
' Add this department to the treeview
TreeView1.Nodes.Add(tn)
End Sub
|
|
|
|
 |
|
|
 |
|
 |
hi
I am generating a tree view using TreeNodeSrc="A.xml". I want to implement search functionality meaning when the user enter a search word (Which matches with the leaf of the tree)
then i want to expand the tree dynamically.
I used TreeNode.Expanded = True recursively.
sub doParentExpanding(t as Object)
dim tn
t.Expanded = True
if(t.Parent.ToString()= "TreeNode") then
tn=t.Parent
tn.Expanded=True
doParentExpanding(tn)
end if
end sub
is there any problem with this code.
Thanks in advance....
Srikanth
|
|
|
|
 |
|
 |
Hello, it has been more than a year since I have not used the treeview control but, have you tried setting the SelectedNodeIndex property of the treeview control in your code-behind to the node you want to expand?
Thanks,
SeaWater
|
|
|
|
 |
|
 |
Thank you i found the solution.
|
|
|
|
 |
|
|
 |
|
 |
Great, you found a solution. What a worthless post. How about some details.
|
|
|
|
 |
|
 |
Great
modified on Tuesday, May 5, 2009 8:40 AM
|
|
|
|
 |
|
|
 |
|
 |
Does any one know how to access the WebControls through COM?
|
|
|
|
 |
|
 |
Hello...
i've got another problem with treeview control and as u seem to be a bit more a ease with treeview than me... i'm gonna ask u a lil question and hope u can answer it (plz).. I need to prevent my users from clicking and using 'enter' & 'direction' keys on my treeView control (at some point in my program)but can't achieve this my normal JavaScript.... do u have a tip 4 me plz? (btw i managed to prevent my user from clicking on the TreeView)
(another thing my treeview is in a frame)
Thanks in advance
bracoute
56Kbps of sighs
|
|
|
|
 |
|
 |
I did not quite understand your problem.
But one thing I can tell you is that you do not require a frame for a tree control to provide for scrolling. If this is what you've done then this could be the problem.
You can acheive the scroll bars by simply specifying the width and height attributes for the tree control itself.
This will let the user click on the + sign to expand and - sign to hide the child nodes. This will also prevent - automatically moving the focus to the root node each time a node is clicked on.
Hope this helps...
Sudhakar
|
|
|
|
 |
|
 |
Hi,
I have this scroll bar problem. These scroll bars do appear on IE but not on Firefox. The entire tree falls on the page like a layer over other parts.
Please do let me know how can this be solved for firefox browsers.
Thanks,
Vivian Aranha
|
|
|
|
 |
|
 |
Just what I was looking for
|
|
|
|
 |
|
 |
Your Welcome, glad to be of help.
|
|
|
|
 |