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 633015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:08:20+00:00 2026-05-13T20:08:20+00:00

Im using treeview in asp.net how can i check if parent contains childnodes in

  • 0

Im using treeview in asp.net

how can i check if parent contains childnodes in treeview selected node changed event.

  • 1 1 Answer
  • 1 View
  • 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-13T20:08:21+00:00Added an answer on May 13, 2026 at 8:08 pm

    In case you want to look if the parent of the selected node contains other children nodes, it is safe to say

    bool ContainsOtherChildren = treeView1.SelectedNode.Parnet.ChildNodes.Count > 1;
    

    since you know that it already has at least one child node (the selected one)

    I would however make another check if there is indeed a parent such as

    if(treeView1.SelectedNode.Parent != null)
    {
       ContainsOtherChildren = treeView1.SelectedNode.Parnet.ChildNodes.Count > 1;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to do following - ASP.NET 2.0 TreeView and Selecting the Selected Node using
im using treeview in asp.net treeview like *parent @child1 .child2 *parent .child if i
I am trying to create a treeview dynamically using c# and asp.net. I have
How can I get a master page for asp.net with 3 sections using divs
How to get the parent node name of the checked child node of ASP.net
I using TreeView with ShowCheckBoxes=All in an ASP.NET 3.5 web application and for some
Right now I am using a ASP.NET TreeView with checkboxes enabled in my page,
I am using the teleriks treeview control (asp.net mvc extensions), where I may have
I am currently using an asp.net menu control to load from a table parent/child
In a asp.net web site I'm using a TreeView to display data from a

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.