---
title: "Datagridview dont get update of DataTable"  
description: "Datagridview dont get update of DataTable"  
author: "kap roma"  
published: 2014-07-25  
updated: 2014-07-28  
canonical: https://www.mindstick.com/forum/2026/datagridview-dont-get-update-of-datatable  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# Datagridview dont get update of DataTable

Hello,At first i fill of my Main_GUI-[Class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) a [DataTable](https://www.mindstick.com/blog/195/datatable-in-ado-dot-net) in my "Controler"-Class.Methode of "[Controller](https://www.mindstick.com/blog/273/passing-values-from-controller-to-view-in-asp-dot-net-mvc)"-Class returns DataTable to the [GUI](https://www.mindstick.com/forum/12743/on-button-click-sending-feedback-gui-module-as-a-pop-up-window-and-on-click-of-submit-adding-to-database-using-jquery-dialog-method)-Class:\
A Problem is, when i [update](https://www.mindstick.com/forum/156353/what-is-hummingbird-update) my DataTable in my "Controler"-Class of some other GUI-Class, my Main_GUI-Class does not show me new [Data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science) on the [Grid](https://www.mindstick.com/forum/369/how-can-i-add-a-column-name-to-my-grid).\
**That is my [Code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii):**\

```
public class Controller{        DataTable globalDataTable	public DataTable updateData(string param){        			globalDataTable = sqlClass.getSQLData(); 	}}public partial class mainGUI: Form{	Controller myController;	private void mainGUI_Load(object sender, EventArgs e) {         	myController = new Controller();                 myGrid.DataSource = myController.updateData("111"); //now Grid shows me Data from DataBase.	}}public partial class subGUI: Form{	Controller control;                public void initilize(Controller cr){		this.control = cr;       }               private void sub_Load(object sender, EventArgs e) {         	             //...        }                private void someMethode(){		control.updateData("222"); //now i change my DataTable on "Controller"-Class							//but the mainGUI does not recognize new Data and does not show these on Main-gui       }}
```

\
How can i [solve this problem](https://answers.mindstick.com/qa/94681/my-google-assistant-shows-completely-different-search-results-from-what-i-ask-how-can-i-solve-this-problem)???Thanks

## Replies

### Reply by Sumit Kesarwani

Hi kap, Whose grid are you using, Windows Form C# or some others??

### Reply by kap roma

Hello :)Sadly i dont have this Funktion in my Grid.I have just "DataBinding" and Event "DataBindingComplete".\
What can i do?thx.

### Reply by Sumit Kesarwani

Hi kap roma,\
Try this:

```
public partial class mainGUI: Form{	Controller myController;	private void mainGUI_Load(object sender, EventArgs e) {         	myController = new Controller();                 myGrid.DataSource = myController.updateData("111"); //now Grid shows me Data from DataBase.		myGrid.DataBind();	}}
```

\
\
Hope this will solve your [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic)


---

Original Source: https://www.mindstick.com/forum/2026/datagridview-dont-get-update-of-datatable

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
