M
meh
Greeting All;
I have some questions about how to build a treeview node at runtime.
I get data from a SQL database some time 10 records sometimes 500,000
records. In one of the columns I get a string that looks kind of like
this...
Section 1:section2/section3.section4.section5. etc.
I parse that out based on the delimiters.
I am trying to dynamically build a treeview from this data. the treeview
nodes have a critiriea that I know what level in the tree they are and as I
get to the end of the string I have to assign data to the node.tag
attribute.
So I think that I have a "collection" of Nodes with these attributes.
nod.Name = currTree.SelectedNode.Name.ToString();
nod.Text = currTree.SelectedNode.Text.ToString();
nod.Tag = currTree.SelectedNode.Tag;
nod.ImageIndex = currTree.SelectedNode.ImageIndex;
nod.SelectedImageIndex =
currTree.SelectedNode.SelectedImageIndex;
nod.ToolTipText = currTree.SelectedNode.ToolTipText;
I then go through the process of building the treeview. This takes approx
800 lines of code to do it line-by-line.
So my question is can I make the nodes a collection of objects and then add
the nodes recursively?
I have found some recursive samples but I'm not sure how to assign the above
attributes during the recursion.
Can someone point me in the right direction?
meh
I have some questions about how to build a treeview node at runtime.
I get data from a SQL database some time 10 records sometimes 500,000
records. In one of the columns I get a string that looks kind of like
this...
Section 1:section2/section3.section4.section5. etc.
I parse that out based on the delimiters.
I am trying to dynamically build a treeview from this data. the treeview
nodes have a critiriea that I know what level in the tree they are and as I
get to the end of the string I have to assign data to the node.tag
attribute.
So I think that I have a "collection" of Nodes with these attributes.
nod.Name = currTree.SelectedNode.Name.ToString();
nod.Text = currTree.SelectedNode.Text.ToString();
nod.Tag = currTree.SelectedNode.Tag;
nod.ImageIndex = currTree.SelectedNode.ImageIndex;
nod.SelectedImageIndex =
currTree.SelectedNode.SelectedImageIndex;
nod.ToolTipText = currTree.SelectedNode.ToolTipText;
I then go through the process of building the treeview. This takes approx
800 lines of code to do it line-by-line.
So my question is can I make the nodes a collection of objects and then add
the nodes recursively?
I have found some recursive samples but I'm not sure how to assign the above
attributes during the recursion.
Can someone point me in the right direction?
meh