473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ExpandAll Corrupts HTML Table format of TreeView Control

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();
Aug 23 '06 #1
1 2242
Fix was to use <td width="150"rather than <td style="width: 150">.

Strange that the former works with manual node expansion, and that all DHTML
tips urge you to use the style= format....

Hope this helps other who may come across the same issue.

"Woof" wrote:
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();
Aug 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Satish | last post by:
hi, I have a SQL Table in the below format Code | Item1 | Item2 | Item3 C1 01 00 00 C2 01 01 00 C3 01 02 00 c4 01 02 01
2
by: Thomas | last post by:
Greetings to all, I would like to save the catalogs (disc tree) of various CDs to an Access table then use the Treeview control to view the contents to find files and so on at a later time instead...
6
by: Danny Lesandrini | last post by:
I'm using an Access database to drive a web site and the colors of various table backgrounds are stored in Access. I want users of the Access database to be able to select colors for the site, but...
5
by: Charlie | last post by:
Hi: I would like to implement a TreeView Control in a web page. Is this done with scripting or does it require an ActiveX control? Can someone point me in right direction? Thanks, Charlie
0
by: timbobd | last post by:
I have a Windows Form application using a TreeView. I added buttons to automatically expand or collapse all rows up or down a level when pressed, and wrap all instructions in BeginUpdate /...
0
by: Mick Walker | last post by:
Hi All, Just looking for a few pointers here. I have been giving the task of pulling a table from an SQL Server, to do this, I simply created a class, and return a List (of <class>). This all...
7
by: SteveM | last post by:
I am sure this is an easy question, but being relatively new to ASP.NET programming, I can not quite grasp what I need to accomplish what I need to do. What I have is a word document that is...
0
by: DesCF | last post by:
I have used Access to convert the Employees table from the Northwind sample database to an XML file. I have then tried to display the XML file in a web page using the TreeView control. The...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.