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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:30:54+00:00 2026-06-06T23:30:54+00:00

Explanation: Coding : for (int i = 0; i < d.Count; i++) //loop for

  • 0

Explanation:

Coding :

       for (int i = 0; i < d.Count; i++) //loop for Product
            {
                TreeNode node = new TreeNode(((string[])d[i])[0]);
                thisForm.NewBKMTreeView.Nodes.Add(node); //add Product as Parent Node

                for (int j = 0; j < b.Count; j++) //loop for Item
                {
                    if (((string[])d[i])[1] == ((string[])b[j])[0]) //compare if ProductID from arrayList d same with ProductID from arrayList b
                    {
                        node.Nodes.Add(((string[])b[j])[2]); //add Item as Child Node
                    }
                }
            }

from the code above.

d is arraylist that hold 2 string.

string[0]       string[1]
ProductName     ProductID
-----------    -----------
  Food             001
  NotFood          002

b also arraylist that hold 3 string

string[0]      string[1]      string[2]
ProductID      itemID          itemName
  001            X101            Soup
  001            X102            Bread
  002            G111            Pen
  002            G212            Book
  002            G222            Ruler

Code to add ProductName as Parent Node :

TreeNode node = new TreeNode(((string[])d[i])[0]);

(((string[])d[i])[0]) hold the ProductName

Code to add itemName as Child Node :

node.Nodes.Add(((string[])b[j])[2]);

(((string[])b[j])[2]) hold the itemName

After run the coding above. the object in arrayList will show in Treeview

+Food
 - Soup
 - Bread
+NotFood
 - Pen
 - Book
 - Ruler

Question :

the treeview is Treeview with Checkboxes. So user can check the item that he want. And copy the item another place. I’ve some problems here. How can i get itemID when user check at nodes?

I want the itemID for get the item that user check to get the data from database and copy it into another place refering to itemID.

  • 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-06-06T23:30:55+00:00Added an answer on June 6, 2026 at 11:30 pm

    I think you should store the item id or any other information you require from the item in the tag property of tree node.

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

Sidebar

Related Questions

I want to add explanation between cells. I'm experimenting with sections, trying to make
I am relatively new to IPhone coding, although I have reached the point of
I've been coding in c++ for 3-4 years now, but I'm pretty new to
I'm relatively new to Java and I'm coding extensions/plugins for online game Minecraft. I've
Explanation: i have few objects and im declaring them inside $(document).ready(). WHY? because in
Explanation I have a multidimensional array that is iterated over to created a categorized
Quick Explanation One Silverlight (3.0) project with several XAML pages. I want to load
Short explanation of my problem, I need to parse an object and put its
Possible Duplicate: A concise explanation of nil v. empty v. blank in Ruby on
I found the explanation defining WIN32_LEAN_AND_MEAN "reduces the size of the Win32 header files

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.