本文介绍了从子窗体刷新父窗体datagridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Visual Studio 2010中做一个项目

.Net Framework 4.0

问题:

我有两种形式。 Form1 包含 datagridview ,由学生信息填写。 datagridview 旁边有按钮。从 datagrid 中选择一行后,单击按钮。然后我的 Form2 将弹出,它将包含来自 Form1 Datagridvie w选定行的详细信息。在 Form2 这里我可以编辑细节,我可以更新。它也会在我的 sql数据库中发生变化。到这里一切都很好。但当我关闭 Form2 时,我想自动刷新 Form1 datagridview 。它没有发生。我试过很多方面。还没有解决方案。请给我一个想法,正确地做到这一点。在此先感谢。



请帮助我!

I am doing a project in Visual Studio 2010
.Net Framework 4.0
Problem:
I Have two forms. Form1 contains a datagridview which is filled by students Information. next to datagridview there is button. after I select a row from datagrid and I click on the button. then my Form2 will popup and it will contains the details which are from Form1's Datagridview's Selected row. here in Form2 I can Edit the details and I can update. it will changes in my sql database as well. up to here everything is fine. but when I close my Form2 I want to refresh my Form1's datagridview automaticaly. its not happening. I tried in many ways. no solution yet. Please Give me an Idea to do it correctly. Thanks in Advance.

Help me Please!

推荐答案

Form1_Load(null,null);





它会自动更新你的datagridview。





问候

Animesh



and It will upate your datagridview automatically.


Regards
Animesh




这篇关于从子窗体刷新父窗体datagridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 01:25
查看更多