如何在另一个mdi子窗体的按钮单击上刷新一个mdi子窗体的gridview。 [英] How to refresh gridview of one mdi child form on button click of another mdi child form.

查看:129
本文介绍了如何在另一个mdi子窗体的按钮单击上刷新一个mdi子窗体的gridview。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

As i am new to windows Applications i want to know how to refresh an gridview. I Have an MDI parent (AdminPanel) and it has two child Form.

1-EditEmp 2-ShowEmp

There is an DataGridview on ShowEmp.cs and when i click on an edit button in the gridview it opens EditEmp.cs with the values.. When i click on the update button Record in the database is updated and the EditEmp form got closed but datagridview on ShowEmp shows the earlier values.. It is refresed only when i close that form and again opens it..

I want to know how to refersh that gridview when the form EditEmp got closed..without closing the form that contains the gridview..

推荐答案

Sergey Alexandrovich Kryuokov写道:
Sergey Alexandrovich Kryuokov wrote:



这是使用MDI child的最佳方式:从不使用MDI。以下是这个想法:谁需要MDI?为什么折磨自己并吓跑用户? [ ^ ]


Here is the best way of using MDI child: never using MDI. Here is the idea: who needs MDI, ever? Why torturing yourself and scaring off your users?[^]



我100%同意他。



另一方面,你在谈论在表格之间传递数据 [ ^ ]。



按照提供的链接找出解决方案。


I agree with Him in 100%.

On the other hand, you're talking about passing data between forms[^].

Follow the links provided to find out the solution.


EditEmp e = new EditEmp();
e.ShowDialog();
BindGrid();


这篇关于如何在另一个mdi子窗体的按钮单击上刷新一个mdi子窗体的gridview。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆