I've inheredted a program that used WinTree and images stores in a SQL database. I am trying to re-create the tree so that i can exctact the data and get the parent child relationships which are not stored anywhere else inthe SQL database.
The prgrammer used VB.net 2005 and Net Advantage 2007.
I can add WinTree as a reference and I've used the Imports. But I don't see the control to add to the project.
Help
Victor
Swindellvc@cofc.edu
Hi Victor,
I'm not sure what you are trying to do or what your question is.
If you have an existing application you are trying to work with, then why would you need to add a control to anything?
If you are trying to add a control to the form and you don't see that control in the Toolbox, then the easiest thing for you to do is use the Infragisitcs Toolbox Utility. There should be a shortcut on your Start menu which gets installed with NetAdvantage.
I found the answer of of how get the control in the tool box
bus as for what I'm trying to do.
The old application written in spagetti code stores the tree data in an SQL database in an image field
I'm tring to access, retrieve and recreate the tree data in order to extract the relationships (filenames) of the parent and children. Of the tree.
I know the previous programmer(s) used VB.net 2005, and WinTree in NetAdvantage 2007...but there is NO doumentation on how to use it.
I've gotten as far as retrieving the data, I'm just trying how to take the memory stream data and have tge tree use it to display the data.
Hope that clears it up.
I am displaying trees that were saved data in a SQL database. basically I'm
What I want to do is travere the tree, and dump all the data out of the tree, ID, parent ID..etc into an excel spreadsheet, so that I can compare it's data against other information in the database.
You said you had an easy way to do this?
Victor said:use the MemoryStream data and attach it to the Ultra Tree control
What do you mean by this, exactly? You cannot bind any control to a MemoryStream. So you mus either by retreiving the data from the memory stream into some other data structure and binding it to the tree, or else you are manually getting the data from the stream and building the tree nodes yourself. Or... a third possibility is that you are using the Save and Load methods on the tree. My guess is it's the latter.
If that's the case, then you would have to loop through all of the tree nodes recursively. I have already posted code in this thread which demonstrates how to do that.
So what you would do is use the Infragistics Excel assembly to create an Excel Workbook, add a Worksheet to is and then as you traverse the tree nodes, you would write that information into the Worksheet.
After you finish traversing the tree, you save the Workbook to a file using the Save method on the Workbook.
If your tree is using columns, then this will be a little bit tricker, since you will have to keep track of when to export the column headers.
Public
TreeDocRec)
'ms- is the Memory Stream containing the Tree Data Structure
'ThisDataRec - is a structure that has information about the datanase record that goes with the
' tree
= 0
Nothing
UltraTreeNode
Then
Try
frm_Main.UltraTree1.Nodes.Clear()
frm_Main.UltraTextEditor1.Clear()
= ms.Length
ms.Seek(0, IO.SeekOrigin.Begin)
frm_Main.UltraTree1.LoadFromBinary(ms)
frm_Main.UltraTree1.Nodes(0).Override.NodeAppearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True
frm_Main.UltraTree1.Nodes(0).Override.NodeAppearance.Image = 0
frm_Main.UltraTree1.DataSource = ms
frm_Main.UltraTree1.Refresh()
aNode = frm_Main.UltraTree1.Nodes(0)
frm_Main.UltraTree1.Nodes IterateTreeNodes(rootNode)
IterateTreeNodes(rootNode)
Next
System.Exception MessageBox.Show(
MessageBox.Show(
+ exp.Message)
Finally
ms.Close()
ms =
Else
'Dim nNode As New Infragistics.Win.UltraWinTree.UltraTreeNode
UltraTreeNode nNode.Text = ThisDataRec.NodeName nNode.Key =
nNode.Text = ThisDataRec.NodeName
nNode.Key =
'CType(SelectedFolder.FolderID, String) 'aNode.Key
nNode.DataKey =
'0
nNode.Tag =
'SelectedFolder
frm_Main.UltraTree1.Nodes.Add(nNode)
nNode.Override.NodeAppearance.Image = 0
nNode.Override.SelectedNodeAppearance.Image = 1
System.IO.MemoryStream frm_Main.UltraTree1.SaveAsBinary(ms)
frm_Main.UltraTree1.SaveAsBinary(ms)
If
Sub
Right now I'm trying to figure out how to extrace Node, info so that I can dump it in a file and then use this info to compare against the data in another DB that that has information on each document that is represented in the tree.
So far I have
are there any other properties/values I should be extracting?
DataKey is only used if you chose to use it. The tree does not use the DataKey. It's sort've like an extra Tag.
Key and Text are the main properties of a node, usually.
If your tree displays in a grid style, with columns, then you will probably also want to store the value from each cell in the Cells collection of the node.
Beyond that, there are appearances applied to the node and the tree, but I don't know if those are necessary for your application.