如何以MDI形式从一个子屏幕向网格视图输入数据

如何以MDI形式从一个子屏幕向网格视图输入数据

本文介绍了如何以MDI形式从一个子屏幕向网格视图输入数据.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have a MDI window with a datagridview control which is used to display a list of records in a database table(s). If the user wants to add a new record, they click "new" and a popup(Child) window displays. The popup window accepts data from the user (name, number, date, etc) and is then submitted.when the users clicks an ok button. At this point I want to update the database with the new record, close the popup(child) window, and then refresh the parent window datagridview so that it reflects the newly added record that was created using the popup window.

The child form will appear on clicking the menue.

while child window closing event how to handle refresh MDI Parent DataGridview?


Regards,
Sarthak Mishra

推荐答案

MyPopup myPop = new MyPopup();
if (myPop.ShowDialog() == DialogResult.OK)
   {
   string name = myPop.ClientName;
   string mobile = myPop.MobileNumber;
   ...
   myDataGridView.Rows.Add(name, mobile, ...
   }



这篇关于如何以MDI形式从一个子屏幕向网格视图输入数据.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-17 02:09