Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6904761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:06:04+00:00 2026-05-27T08:06:04+00:00

I am experiencing an odd behaviour from a TreeView control. As you can see,

  • 0

I am experiencing an odd behaviour from a TreeView control.

enter image description here

As you can see, the last node in the treeview is somehow hidden (although I can select it with keyboard up/down arrow keys) and the scroll bar does not expand to it. In the picture the blue line you see is the selected node that is hidden but luckily still a bit of highlight is visible!

Even when I press pagedown or END keys, I cannot select the last node!

I tried to change height of the treeview control to match the height of nodes but still no success! My treeview is inside a ‘panel’. could it be the problem?

UPDATE
I am not doing something extraordinary. I just populate with a loop over a List<> (using suspend and resume before and after loop) then the treeview will be populated normally.

public class MyNode
{
public string Name {get;set;}
public string Result {get;set;} 
}
//suspending code here (dont have access to paste it here)
    foreach(MyNode node in myNodeList)
    {
    TreeNode tn = new TreeNode();
    tn.Text = node.Name;
    tn.Name = node.Result;
    treeView.Nodes.Add(tn);
    }
////unsuspending code here (dont have access to paste it here)

Later I allow user to press a button to highlight the nodes that have result set to ‘fail’:

foreach(TreeNode node in treeView.Nodes)
{
if (node.Name.ToString() == "fail") node.BackColor = Color.Red;
}

After this, the last node in the treeview is going hidden!!!

FIX
I used BeginUpdate() and EndUpdate() methods and the problem is gone!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:06:05+00:00Added an answer on May 27, 2026 at 8:06 am

    I found out that I have to user treeView.BeginUpdate() and treeView.EndUpdate() methods before and after populating the tree view and also making any changes to its nodes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am experiencing some very odd timing behavior from a function I wrote. If
I am experiencing some odd behaviour with NHibernate. I'm retrieving a list of Learners
I'm experiencing odd behavior after adding options to a select via ajax. After adding
I'm experiencing a behaviour of Google Chrome (Google Chrome 7.0.517.41 beta) that I can't
I am experiencing something odd, please see below. Why is alert 1 outputting 0
I am experiencing an odd issue. I just switched to FastCGI (Apache) because of
I have recently begun experiencing several odd issues with the Android SDK and I
I'm experiencing a strange behaviour when looking via reflection for annotations on a method
I'm experiencing something odd here, that I don't recall ever running into. I'm doing
We are experiencing an odd problem. We get the KeySet of an Oracle Coherence

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.