---
title: "How to display data results in DatagridView in another Form?"  
description: "How to display data results in DatagridView in another Form?"  
author: "Pravesh Singh"  
published: 2014-10-20  
updated: 2014-10-20  
canonical: https://www.mindstick.com/forum/2421/how-to-display-data-results-in-datagridview-in-another-form  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How to display data results in DatagridView in another Form?

I'm having a tough time [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to display my [data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science) information in another form which has a [DataGridView](https://www.mindstick.com/articles/607/working-with-datagridview-in-vc-sharp), if a [button is clicked](https://www.mindstick.com/forum/157821/write-a-jquery-code-that-selects-all-the-checkboxes-in-a-form-when-a-select-all-button-is-clicked)\
\
To display the [results](https://yourviews.mindstick.com/story/4497/usage-of-baking-soda-magical-results) in the same Form in dgv isn't a [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) but to display it in Form 2 in a dgv is [giving](https://yourviews.mindstick.com/view/80639/regifting-is-far-better-than-giving-away-a-bouquet) me a headache (:\
\
Example:\
Form1\
cmd.commandText: [SELECT](https://www.mindstick.com/forum/160534/orderby-then-select-vs-select-then-orderby-performance) * FROM tblproducts\
\
**void btnDisplay_Click(object sender, EventArgs e)**\
\
if (comboBox1.SelectedValue.ToString() != null && comboBox2.SelectedValue.ToString() != null)\
\
try \
open [connection](https://www.mindstick.com/articles/13012/what-makes-ethernet-connection-better-than-wifi)\
new Form2().ShowDialog();\
\
?????? what next??\
\
Form2\
\
dataGridView1.DataSource = get Info from Form1;

## Replies

### Reply by Anonymous User

Why don't you add a static class to your project, populate this in Form1 then add a property to the static class holding your list of objects, then bind this to your datagridview in Form2??\
Form1open connectionnew Form2().ShowDialog();Form2.Passvalue = dataGridView1.DataSource; \
public partial class DataGridView : Form2{ private string Data; public string Passvalue{ get { return Data; }set { Data = value; } } public DataGridView(){InitializeComponent();} private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e){dataGridView1.DataSource = Data;}


---

Original Source: https://www.mindstick.com/forum/2421/how-to-display-data-results-in-datagridview-in-another-form

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
