473,382 Members | 1,647 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,382 software developers and data experts.

treeview node text not displaying correctly

NJP
Hi Guys,

I have a simple treeview on my webform (C# 2.0). I am dynamically
populating the treeview with nodes. On my leaf nodes i want to have
text seperated by a large amount of blank space like shown below
Name BirthDay Photograph
Parent
|__Child1 20/08/1982 c:\documents
\file111\child1.jpg
|__Child2 19/02/1992 c:\documents
\file111\child2.jpg
however when I populate the treenode using the code below
TreeNode service = new TreeNode(ChildName + " " +
BirthDay + " "+ Photograph,
child.ID.ToString(),"","ChildDetails.aspx?CID=" + child.ID,"");
I get the tree below
Name BirthDay Photograph
Parent
|__Child1 20/08/1982 c:\documents\file111\child1.jpg
|__Child2 19/02/1992 c:\documents\file111\child2.jpg
All the whitespaces in between have been trimed to One whitespace.
How
can I try and make sure that I get the requisite whitespace. I have
tried \t as well but that didnt work either. Your help is much
appreciated.
Thanking You,
NJP

Mar 4 '07 #1
1 1789
On Mar 4, 11:53 pm, "NJP" <NJPS...@gmail.comwrote:
Hi Guys,

I have a simple treeview on my webform (C# 2.0). I am dynamically
populating the treeview with nodes. On my leaf nodes i want to have
text seperated by a large amount of blank space like shown below

Name BirthDay Photograph

Parent
|__Child1 20/08/1982 c:\documents
\file111\child1.jpg
|__Child2 19/02/1992 c:\documents
\file111\child2.jpg

however when I populate the treenode using the code below

TreeNode service = new TreeNode(ChildName + " " +
BirthDay + " "+ Photograph,
child.ID.ToString(),"","ChildDetails.aspx?CID=" + child.ID,"");

I get the tree below

Name BirthDay Photograph

Parent
|__Child1 20/08/1982 c:\documents\file111\child1.jpg
|__Child2 19/02/1992 c:\documents\file111\child2.jpg

All the whitespaces in between have been trimed to One whitespace.
How
can I try and make sure that I get the requisite whitespace. I have
tried \t as well but that didnt work either. Your help is much
appreciated.

Thanking You,

NJP
Yep, in old-school Delphi world, there was a component for this type
of layout called TreeList. This would be basically a treeview, but
with columns
This is very difficult (if not impossible to do) with the current
rendering of the treeview in ASP.NET.

I am using a third party grid component for this type of layout (but
it is commercial)
http://www.telerik.com/demos/aspnet/...DefaultCS.aspx
Mar 5 '07 #2

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

Similar topics

2
by: Irishmaninusa | last post by:
Hello, I am a newbie to asp.net and I am trying to do sample code using the treeview code, and for some reason it is not displaying the way I would expect it to display. HEre is the code in...
6
by: L.M | last post by:
Hello, I knew how to use the treeview under VB6. After migrating to .NET, well, I'm lost. I try to add a new node, either to the same level or as a child to a selected node in the treeview....
12
by: Bob Hollness | last post by:
Hi. I have a text file containing a list of files and their path. I.e. c:\MyDocs\File1.txt c:\MyDocs\File2.txt c:\MyDocs\File3.txt c:\MyDocs\File4.txt C:\MyDocs\Folder\File1.txt
0
by: stardust | last post by:
Hi everyone, Within a Winform application, a treeview is contained in a User Control and the User Control is then located within a splitview. When the UserControl added some nodes into the...
1
by: Alex D. | last post by:
hey guys I found what is causing the problems with my treeview in Firefox...the answer is: treeview+dropdwonlist in the same page dont work! try this simple code and see for yourselves. you can do...
7
by: tman | last post by:
I am generating a very large tree list in my program and while it's performance is great once loaded it takes a really long time to load. I create a root TreeNode "offline" and go through the...
8
by: Jon Slaughter | last post by:
I'm trying to override the default paiting of a treeview but I get bad results: My code(well, atleast this is the most simple that reproduces the result) is this private void TVDrawNode(Object...
1
by: doemon | last post by:
Hi, I'm working on a pagination control and I need to dynamically rerender a treeview to display the next set of nodes depending on which page we're on. For example, page 1 will dispaly only...
0
by: jiing | last post by:
Hi all, I want to use sting(the same as Node.Text) to judge if a node exists in TreeView. I've tried several ways, but seems all failed. could anybody help me? Thanks in advance. //My...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.