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

Windows Treeview not rendering for single node

2
In my windows form project (VS2010) I have a treeview object that is populated based upon a drop down selection.

Initially when I have one node populated in the treeview (at startup) it displays fine. If I navigate away from that (by selecting another option) which has multiple nodes and it renders fine.

When I go back to the selection that has a single node it does not display at all. If I double click in the area the node should be, the double click event fires. If I add a value as a second node, it renders correctly every time.

The treeview control is not bound to a datasource. It is built by looping through the data and then building the child nodes as it populates the parent.

This behavior exists only in the circumstance where I have only one parent node. I tried executing an expand all method which works if I have at least one child.

Again, this only occurs after making other selections. The initial startup uses this same selection and renders just fine.

For options 1 & 3, I always populate the child data. On options 2 & 4 I do not populate the child data until after the parent node has focus (in the interest of response time.)

My problem only occurs after executing options 2 or 4. I can cycle through 0,1 and 3 (zero being no selection) and everthing renders okay but once I execute 2 or 4 my problem starts to occur.

Any Ideas out there?
Dec 30 '11 #1

✓ answered by tmann

Found it!

After I clear the nodes I added a '.BeginUpdate()' prior to the load subroutine.

Before exiting (after the nodes are loaded) I added a '.EndUpdate()' which seems to trigger a rendering event and redraws the control.

With those changes in place it works just fine.

1 1654
tmann
2
Found it!

After I clear the nodes I added a '.BeginUpdate()' prior to the load subroutine.

Before exiting (after the nodes are loaded) I added a '.EndUpdate()' which seems to trigger a rendering event and redraws the control.

With those changes in place it works just fine.
Dec 30 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: **** KiteOregon **** | last post by:
I want to use a treeview but also have the ability to have some buttons that will allow me to set some attributes of the item in the tree view. ie.. Company -company a...
0
by: Rich Noons | last post by:
If you're trying to sort a treeview with a single root node, and unsorted child nodes, this doesn't work in VS.NET 2003 in c# (anyway). eg +D -----A
4
by: Patrick F | last post by:
how do i select a single node value from the list? ive tried with this, but it dosent work =/ private string FetchFieldFromXml(string strId) {
1
by: Maileen | last post by:
Hi, I have on my form a treeview control with several nodes. when my form is loaded, I would like to preselected the 1st node of my treeview and to see it selected (highlighten node text) how...
1
by: bill | last post by:
When PopulateOnDemand is true, the treeview event handler for the TreeNodePopulate event gets the TreeNodeEventArgs as a parameter. The TreeNodeEventArgs contains the tree node to be populated,...
5
by: uspensky | last post by:
We are trying to setup a system to system failover cluster using two nodes (x346) which each have a single hba running to seperate controllers on the DS400. For full redundnancy, IBM recommends...
2
by: Pucca | last post by:
How do I make the TreeView control's node text (or label) editable when user click twice on it? (Not double click). It's like the explorer on our computer drives. The directory tree label...
1
by: Falcula | last post by:
Hello, I have a treeview control, when i select a item i navigate to url. But selected node is lost, it reset itself, loosing state. I post my code here. Thanks in advance. <script...
2
by: michelqa | last post by:
Hi, I'm trying to add nodes to a specific node of a treeview. With VS 2005 and more (>= .net 2.0) I can set the Nodes.Name property and then use Nodes.Find("MyNodeName",true) to add nodes to a...
2
by: monsalvo | last post by:
What's so wrong with my code? This line is part of a VBScript soap client part of a DTS wich is functional in a 90 percent. strText = .responseXML.selectSingleNode("//" login "loginReturn") ...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.