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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:29:33+00:00 2026-05-19T04:29:33+00:00

I am currently refactoring some of my old code that is pretty terrible. I

  • 0

I am currently refactoring some of my old code that is pretty terrible. I will have a class that creates a Treeview, populates the node, etc and is displayed on a Winform.
Each node on the Treeview represents some data and when the user clicks on that then a datagridview is also displayed on the Winform. The datagridview will be generated within a new class also.

My idea on this is, when the Winform Loads, create and display the Treeview and use an event to monitor for node clicks. When the Winform handles such an event, then it creates the datagrid object and diplays that.

IS this the best way to architect this?

Thanks.

  • 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-19T04:29:33+00:00Added an answer on May 19, 2026 at 4:29 am

    Yes, what you describe is a standard way to do things in WinForms.

    You don’t need to create the DataGridView every time though – just place it on the Form and in the event handler load the data from somewhere and change the contents of the DataGridView by assigning to DataGridView.DataSource.

    In the form designer, define columns for DataGridView and set their DataPropertyName to the names of the corresponding properties of the data objects in the collection.

    Note: the data assigned to the DataGridView.DataSource can be a collection of objects or also a DataTable if you are using ADO.NET to read the objects from a database.

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

Sidebar

Related Questions

I'm currently refactoring some Javascript code we have and amongst other things I've changed
I am currently refactoring some old code. I am looking for directions on the
I am currently refactoring some code which performs Windows Impersonation for testability and have
I'm currently refactoring some ugly code and splitting a large and overcomplicated class A
I'm refactoring some code that currently looks like this: $$('#wrapper > div').each(function(e){ if((e.id!='header') &&
I'm currently refactoring some code the explicitly specializes a member function of a class
I'm refactoring some code and I have written a method that modifies a Dictionary
I'm currently refactoring/tidying up some old C code used in a C++ project, and
I'm currently refactoring some code on a project that is wrapping up, and I
I am currently refactoring some code for work and I have come across some

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.