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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:07:52+00:00 2026-05-16T16:07:52+00:00

I would like to have an array of treenode in such a way that

  • 0

I would like to have an array of treenode in such a way that if i add a custom node along with that the remaining Nodes declared in the array should be added as child nodes to that custom node added.

Initially i will have a treeview with a Header node if i righ click on that i will have contextmenu with an option addnew. when i click on that i will have a save file dialog option to save a file and i will bind it as child node to that root node. ALong with that i would like to add some more nodes as child nodes to the binded one

  • 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-16T16:07:52+00:00Added an answer on May 16, 2026 at 4:07 pm

    This got the answer for me

    private void AddNew_Click(object sender, EventArgs e)
    {
        Stream myStream;
        SaveFileDialog saveFileDialog1 = new SaveFileDialog();
    
        saveFileDialog1.InitialDirectory = @"C:\";
        //saveFileDialog1.CheckFileExists = true;
        //saveFileDialog1.CheckPathExists = true;
        saveFileDialog1.DefaultExt = "txt";
    
        saveFileDialog1.Filter = "(*.txt)|*.txt";
        saveFileDialog1.FilterIndex = 2;
        saveFileDialog1.RestoreDirectory = true;
    
        if (saveFileDialog1.ShowDialog() == DialogResult.OK)
        {
    
            if ((myStream = saveFileDialog1.OpenFile()) != null)
            {
    
                string FileName = saveFileDialog1.FileName;
                TreeNode newNode = new TreeNode(FileName);
                newNode.SelectedImageIndex = 1;
                tvwACH.SelectedNode.Nodes.Add(newNode);
                newNode.Nodes.Add("FileHeader");
                newNode.Nodes.Add("BatchHeader");
                newNode.Nodes.Add("EntryDetail");
                // TODO: Add code here to save the current contents of the form to a file.
                //myStream.Close();                
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array that I would like to sort using a date field
I have an array of custom hooks I'd like to schedule, built along these
i would like to have an array of objects in excel that call one
I have an array that contains several arrays and I would like to order
I would like to have an array (or a vector) and at each position
I have the array shown below. I would like to have a resultant array
I have an array of 50 items and I would like to choose 5
i have an array $mainArray of arrays and i would like to remove /
I have an array of sprites called segments and I would like to skip
We have an array of points through which we would like to draw 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.