473,549 Members | 4,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TreeView woes in VS2005

Hi,

I'm trying to use the standard TreeView in VS2005 ( under the navigation
menu ). But I cant get any events to postback and none of the style
settings are being applied. None of the property settings seem to be
working either. The "ShowLines" property ( and others ) is working in the
designer but not when the page renders

I must be missing something simple, but for the life of me, I cant see what
it is.

HELP!
Jun 18 '07 #1
5 1207
"Josh" <s@a.comwrote in message
news:e4******** ******@TK2MSFTN GP03.phx.gbl...
I'm trying to use the standard TreeView in VS2005 ( under the navigation
menu ). But I cant get any events to postback and none of the style
settings are being applied. None of the property settings seem to be
working either. The "ShowLines" property ( and others ) is working in the
designer but not when the page renders

I must be missing something simple, but for the life of me, I cant see
what it is.
What you've actually forgotten to do is post your code so that we can help
you...
--
http://www.markrae.net

Jun 18 '07 #2
What you've actually forgotten to do is post your code so that we can help
you...
Heres what I'm doing to populatethe node. They all appear. The doPostBack
is running but no server side event fires.

private void loadMenu()

{

//clear up any existing nodes

TreeView1.Nodes .Clear();

// get the data for the nodes

SqlStatement query = new StoredProcedure (@"SelectMenu") ;

DataTable table = query.ExecuteDa taTable();

// process each parent tree node

foreach (DataRow dr in table.Rows)

{

if (dr["biParentSiteMa pNodeID"] == DBNull.Value)

{

TreeNode tn = new TreeNode(dr["vcTitle"].ToString(),
dr["biSiteMapNodeI d"].ToString());

AddChildMenuNod es(tn,table);

TreeView1.Nodes .Add(tn);

}

}

}

/// <summary>

/// recursive function to populate tree nodes

/// </summary>

/// <param name="tn">paren t tree node</param>

/// <param name="dt">compl ete datatable of all menu nodes</param>

private void AddChildMenuNod es(TreeNode tn, DataTable dt)

{

int parentID = Convert.ToInt32 (tn.Value); // parent id for who's
children we are looking

foreach (DataRow dr in dt.Rows)

{

if (dr["biParentSiteMa pNodeID"] != DBNull.Value)

{

if (Convert.ToInt3 2(dr["biParentSiteMa pNodeID"]) ==
parentID)

{

TreeNode newTreeNode = new
TreeNode(dr["vcTitle"].ToString(), dr["biSiteMapNodeI d"].ToString());

AddChildMenuNod es(newTreeNode, dt);

tn.ChildNodes.A dd(newTreeNode) ;

}

}

}

}


Jun 18 '07 #3
"Josh" <s@a.comwrote in message
news:el******** ******@TK2MSFTN GP05.phx.gbl...
>What you've actually forgotten to do is post your code so that we can
help you...

Heres what I'm doing to populatethe node. They all appear. The doPostBack
is running but no server side event fires.
Hmm - well, unless I'm missing something, I can't actually see a server-side
event such as SelectedNodeCha nged...
http://www.google.co.uk/search?sourc...tedNodeChanged
--
http://www.markrae.net

Jun 18 '07 #4
Hmm - well, unless I'm missing something, I can't actually see a
server-side event such as SelectedNodeCha nged...
Actually theres no code in it to show, because its' not firing!
Jun 19 '07 #5
"Josh" <s@a.comwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>Hmm - well, unless I'm missing something, I can't actually see a
server-side event such as SelectedNodeCha nged...

Actually theres no code in it to show, because its' not firing!
Er, well, two possibilities, then...

1) you don't have the property set (correctly) in your webcontrol tag...

2) the event hasn't been wired up...
--
http://www.markrae.net

Jun 19 '07 #6

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

Similar topics

5
3058
by: Gerhard Menzl | last post by:
When creating a Managed C++ DLL using the Visual Studio 7.1 Solution Explorer (by selecting Add New Project and then either choosing Class Library (.NET) or Windows Control Library (.NET)), the IDE sets the /MT(d) compiler switch (statically linked multithreaded C runtime library) by default. This is fine with me, as it relieves me from having...
2
2588
by: pmcguire67 | last post by:
There has been a lot of discussion lately about extending the treeview control to allow finding a node by key rather than by index. Everyone seems to agree that a hashtable is needed to accomplish this. Also, there is a KB article (http://support.microsoft.com/default.aspx?scid=kb;en-us;311318) purporting to show you how to extend the treenode...
14
947
by: Bob Hollness | last post by:
Hi all. Is it possible to store some additional information in each node of a treeview but without displaying it? i.e. If, for example, my treeview displayed a list of products. But additionally stored in it is the price of the product. If i clicked on a node, a messagebox would display the product name and the price. But the price is...
2
2556
by: DJohnson | last post by:
Hello everyone, Please forgive me for my ignorance or lack of understanding on the following technology, as I am by no means an expert in serial IO. I am writing an application that communicates to a custom hardware device that requires a 4 byte message to be sent every 500ms to keep it alive. I have used VB6 to create a prototype...
3
1437
by: SteveCriscuoli | last post by:
I originally posted this in microsoft.public.xml ... my apologies to those to who read both groups ... Someone please tell me if I'm missing something here. The XML Comment generator in VS2005 seems to be woefully incomplete. I created a test solution with 2 classes in different namespaces XTest.Derived.DerivedClass XTest.Base.BaseClass
0
6736
by: celoftis | last post by:
Using VS2005, VB code behind, BACKGROUND I'm trying to set up a page with a TreeView of links on the left hand side of my page - when clicked I want the links to open in the remaining portion of the page. The best and easiest way I've found todo this is with using frames (any suggestions on other ways todo this I'd love to hear about it)....
0
920
by: Charlie | last post by:
Hi: My TreeView control is binding to XML using XMLDataSource control. Works well. However when I add a new item to database and requery tree or restart app, new item doesn't appear on tree. It's not until I restart VS2005 does the tree refresh. Sounds like tree data is being cached or something. I've tried nulling out things after...
0
942
by: celoftis | last post by:
Using VS2005, VB code behind, Two questions: 1. Is there a way to control the display properties (i.e. font, font-color, back-color, etc.) per node in a ASP TreeView. (I have a user requirement that states that previously selected nodes need to have a different back ground color than nodes that have not been visited).
12
1276
by: Andrew Wan | last post by:
How different is it to program C# for Visual Studio 2003.NET & Visual Studio 2005? I know Visual Studio 2003.NET uses .NET 1.1, whilst VS2005 uses .NET 2.0. So the question really is, what is the difference & significance of programming C# for .NET 1.1 & .NET 2.0?
0
7526
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7455
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7723
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7480
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5092
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.