G
Guest
Hi,
I'm populating the nodes of a Tree View control via an SQL database, with
the lowest child nodes (leaves from now on) Text field being set to a lengthy
set of HTML. The outcome is a beautifully formated list of data, where the
leaves each show several rows from the SQL database.
THE PROBLEM: When I expand each node level manually (clicking the +), the
table format of the leaves is spot on, with each column of data formated
correctly (I have hard coded the <TD style="width: 150"> tag for each cell>.
However, I've also added a 'Expand All' button at the top of the page which
calls the TreeView.ExpandAll() method. This duly expands all the nodes but
then destroys all the table formating I've created to keep each column of
data spaced correctly.
What have I done wrong?
Many thanks.
If the above didn't make sense, here's an actual line of code from the
project:
node.Text = "<table width=\"600\" class=\"Tree3\"><tr><td
style=\"width: 150\">" +
"<img src=\"images/per.gif\" class=\"TreeImage\"> " +
row["Per_Name"].ToString() +
"</td><td style=\"width: 150\">"
+ row["Rol_Name"].ToString() + "</td><td style=\"width: 250\">"
+ row["Rol_Email"].ToString() + "</td></tr></table>";
node.Value = row["ID"].ToString();
I'm populating the nodes of a Tree View control via an SQL database, with
the lowest child nodes (leaves from now on) Text field being set to a lengthy
set of HTML. The outcome is a beautifully formated list of data, where the
leaves each show several rows from the SQL database.
THE PROBLEM: When I expand each node level manually (clicking the +), the
table format of the leaves is spot on, with each column of data formated
correctly (I have hard coded the <TD style="width: 150"> tag for each cell>.
However, I've also added a 'Expand All' button at the top of the page which
calls the TreeView.ExpandAll() method. This duly expands all the nodes but
then destroys all the table formating I've created to keep each column of
data spaced correctly.
What have I done wrong?
Many thanks.
If the above didn't make sense, here's an actual line of code from the
project:
node.Text = "<table width=\"600\" class=\"Tree3\"><tr><td
style=\"width: 150\">" +
"<img src=\"images/per.gif\" class=\"TreeImage\"> " +
row["Per_Name"].ToString() +
"</td><td style=\"width: 150\">"
+ row["Rol_Name"].ToString() + "</td><td style=\"width: 250\">"
+ row["Rol_Email"].ToString() + "</td></tr></table>";
node.Value = row["ID"].ToString();