|
Is there licensing attached to this code?
Also how do you move the tree structure?
|
|
|
|
|
hi,
Is it possible to create .dll file from user control(.ascx) in C# .net?
If wecan, how do achieve it? please give me a solution ASAP.
Regards,
Yasotha
|
|
|
|
|
i can't move treecontrol , it always appear on the left top of the browser
can you show me how to place it ?
|
|
|
|
|
When the code behind for the control executes response.write(TreeCode), it gives a nullexception because the reponse object is null. Why is this happening? Am i missing something?
regards
Amar
|
|
|
|
|
My output does not work correctly. Parent node "B" is not showing in the initial display -- what is wrong??
Here's my code:
With mrtree1
.AddNodeDiv("Plan", .mrNodeType.mrParent, "A")
.AddNodeDiv("Select Water Body", .mrNodeType.mrChild, "AA", "A")
.AddNodeDiv("Which selection method", .mrNodeType.mrChild, "AAA", "AA")
.AddNodeDiv("Select by Water Body", .mrNodeType.mrChild, "4", "AAA")
.AddNodeDiv("Select by Pressure", .mrNodeType.mrChild, "5", "AAA")
.AddNodeDiv("Do", .mrNodeType.mrParent, "B")
.AddNodeDiv("Create PoM", .mrNodeType.mrChild, "BB", "B")
.AddNodeDiv("Check", .mrNodeType.mrParent, "C")
.AddNodeDiv("Review Status", .mrNodeType.mrChild, "CC", "C")
.AddNodeDiv("Act", .mrNodeType.mrParent, "D")
.AddNodeDiv("Add Corrective Action", .mrNodeType.mrChild, "DD", "D")
.BuildTree()
End With
Upon page load, the tree displays 3 parent nodes instead of 4. Then, when I click on the first parent node ("Plan"), it displays and extends the second parent node that was hidden ("Do") ??
michael waddell ∙ CDM, Inc. ∙ 50 Hampshire Street ∙ Cambridge, MA 02139
|
|
|
|
|
Hi i was working with you code and i think that its great the problem is that im new in this world of the programing so I am wondering if your code can use with data base
I hope you can help me thanks in advance
Regards
I'm nobody! Who are you?
Are you nobody, too?
Then, there's a pair of us!
Don't tell! They'd advertise
You know! how dreary to be somebody
|
|
|
|
|
I have 2 level tree and I want to postback the page with selected 2nd node only not from any other node level?
Does any body have idea?
|
|
|
|
|
Please visit:
http://mozillanews.org/?article_date=2004-07-23+18-06-59
|
|
|
|
|
I tried to use this code but it's not working in Netscape.
Anybody tried this?If 'Yes' let me know what's the solution for this.
Thanks
|
|
|
|
|
The short of it:
On line 146 of mrTree.ascx.vb add this statement: prevLevl = itrNode.NodeLevel
The long of it:
When you have an excessively long branch followed by another branch with at least 2 nodes, you can end up with funky output. Depending on the length of the branch above, the bottom branch will appear prematurely starting from the leaf toward the root.
Not good.
Other Issues:
Also, if you were planning on using the tree to describe drives and folders (like in Windows Explorer), you need to change the JavaScript event handlers that mrTree.ascx.vb writes. The handlers' string parameters that contain a folder address (i.e. C:\Program Files\I sure wish\this code was\documented better) need to have the backslash escaped for JavaScript (i.e. C:\\Program Files\\I sure wish\\this code was\\documented better).
You'll see the JavaScript event handlers in a few places in mrTree.ascx.vb:
line 155 should be changed from:
TreeCode = TreeCode + "<img style=cursor:hand src = Plus.gif id = i" + itrNode.NodeKey + " border = 0 " + " onclick = " + Chr(34) + "javascript:NodeClick('" + itrNode.NodeKey + "','P')" + Chr(34) + ">"
To:
TreeCode = TreeCode + "<img style=cursor:hand src = Plus.gif id = i" + itrNode.NodeKey + " border = 0 " + " onclick = " + Chr(34) + "javascript:NodeClick('" + Replace(itrNode.NodeKey, "\", "\\", , , CompareMethod.Text) + "','P')" + Chr(34) + ">"
I hope that helps!
-Jeepy
|
|
|
|
|
You gotta get rid of those String variables in mrTree.ascx.vb!
Use a System.Text.StringBuilder and your performance will increase dramatically.
Line 8 change to:
Private TreeCode As System.Text.StringBuilder
In Public Sub TreeBuild add this line after the last DIM statement:
TreeCode = New System.Text.StringBuilder()
Replace every instance of:
TreeCode = TreeCode +
With:
TreeCode.Append(
Your performace will increase tremendously!
I'm a bit amazed that a StringBuilder wasn't coded in the first place.
The code has a few string concantinations happening to the same string variable that are looped over and over again - once for each node. Bad, bad, bad! Strings are immutable - they will hose up your performance big time. Ugh.
-Jeepy
|
|
|
|
|
Honestly, I think it's easier to code without Option Explicit and Strict On while you're doing your initial coding, but you should have it turned on as you're doing your debugging and definitely before you release your code.
Put this at the top of all your .vb pages:
Option Explicit On <br />
Option Strict On
Also, you should replace that (microsoft.visualbasic.)Collection object at the beginning of mrTree.ascx.vb with a System.Collections.Queue class - it runs faster. You'll have to change where you add the Node classes, but it's pretty simple...
Change this:
'NodeCollection.Add(NodeData, CStr(NodeCountDiv))
To this:
NodeCollection.Enqueue(NodeData)
You'll notice that you don't need to have the second parameter in there.
Even after all this, you're probably going to want to cache the page output and have it depend on whatever variable makes sense to your particular application. The number of nodes you're adding to the tree makes a big difference in performance.
-Jeepy
|
|
|
|
|
i applied this code, but i didnt felt any difference.
i think you can help me.my problem is in number of contents in a table.
volume of data's in my table is very hugeee. tree code has to handle around 9000 rows.
i wrote the code for display the tree in pageload. but nothing was displaying. but if level of nodes near to 5 then it will work properly. how can solve this problem?
|
|
|
|
|
Just to save some of you a little time that I didn't save...
Make sure when you're using the .AddNodeDiv() method that the 3rd parameter, NodeKey, doesn't include ":\" in the string. The drive variable is structured like this: "A:\", "B:\", "C:\", so you gotta trim off that ":\"
So instead you'll use something like this... (take note of the "Left(drive, 1)")
Dim drives As String()
Dim drive As String
drives = System.IO.Directory.GetLogicalDrives()
For Each drive In drives
mrTree1.AddNodeDiv(drive, mrTree.mrNodeType.mrParent, Left(drive, 1))
Next
-Jeepy
|
|
|
|
|
Help Me, please!!!
I wanted create a dll with Tree Control as was written, but I failed to do it.
With a client Web Page class I can use properties and methods of Dll.mrTree class but nothing appear on my WebPage while browsing.
I think I must register mrTree class in HTML view of WebPage, but how to do it?
Tag Prefix 'uc1" as was in example can't be used as My dll it is not a user control.
I wanted create Dll in your really fine control becouse I use C# and not VB.
So, I wanted to have compiled version of your control for including it to my C# projects.
Help me, please to solve this isure.
Regards,
Oksana
|
|
|
|
|
Hi
I have tree view control, in that i need to insert a small seperate image for the parent node and child node before the text. how can i insert that. please help me for that asap .
with regards
sathiya
|
|
|
|
|
I hope you've figured it out by now (two years later). Look in the BuildTree() function and there are three separate places you need to look but they all begin like:
TreeCode = TreeCode + "
|
|
|
|
|
Little light on the explination, no?
|
|
|
|
|
I agree...
Cmon people!... When you write an article we expect you to explain how it works... not only how to use it!...
Tell us what was good or bad about it, easy or hard, how could you extend it?
Why not do it in C#?
These questions are expected to be answered... not just drop a couple of numbered lines...
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
|
Hi,
Thanks for the comments. I am sorry that I was little short on the explanation. I tried to explain in the How to text file that I included in the source file. Please mail me on what part I can improve my documentation. FYI this is first time for me.
|
|
|
|
|