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

  • Home
  • SEARCH
  • 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 7397885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:48:13+00:00 2026-05-29T03:48:13+00:00

I have a datagridview in form 1 which contains unbound data. How can I

  • 0

I have a datagridview in form 1 which contains unbound data. How can I transfer the data from datagridview in another datagridview2 which is located in form2? Give me some suggestions please!

  • 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-29T03:48:14+00:00Added an answer on May 29, 2026 at 3:48 am

    If you had the DataGridView bound to a table, you would just set a reference in Form2 to the table. In your case, you probably want to have a reference to the actual DataGridView in the second form.

    It’s not the best programming style from a maintenance perspective — it’s better to use a data source.

    Here is a simple idea of one way to show the second DataGridView with the data from the first DataGridView. It’s not perfect, but it should show you the idea.

    public Form2(DataGridView dgvFromFom1) {
      InitializeComponent();
    
      foreach (DataGridViewColumn dc in dgvFromForm1.Columns) {
        dataGridView1.Columns.Add(dc.Name, dc.HeaderText);
      }
    
      foreach (DataGridViewRow dr in dgvFromForm1.Rows) {
        Object[] newRow = new object[dr.Cells.Count];
    
        for (int i = 0; i < newRow.Length; i++) {
          newRow[i] = dr.Cells[i].Value;
        }
        dataGridView1.Rows.Add(newRow);
      }      
    }
    

    Again, though, this would be a lot easier using a DataSource.

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

Sidebar

Related Questions

I have a form with a DataGridView and I want to load data from
I have a form which contains a DataGridView, a BindingSource, a DataTable, and a
I have a form which contains 2 buttons , a datetimepicker and datagridview which
I have a form created which an unbound datagridview that has three columns. Position,
I have a MDI Child Form which contains a DataGridView that is updated continuously
I have a Form with a DataGridView which DataSource is a BindingSource to a
On a Windows form I have an unbound datagridview with 1 user-editable column. A
I have a form that contains dataGridView, whose coloumn are set to dgrv1.Width =dgrv1.Columns.GetColumnsWidth(DataGridViewElementStates.Visible)+20;
I have a datagridview where the users can select which subset of columns to
I have a DataGridView which I am populating from a list of objects. However

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.