C/s 给MDI窗体中的DataGridView赋值。 窗体1 是MDI。点击MDI中的按钮,show出窗体2 ,窗体2中的内容填写完之后,点击保存此时数据无法添加到MDI的DataGridView里面. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1 FormAprivate void tsbtnAdd_Click(object sender, EventArgs e) { FormB b= new b(this); b.show(); }FormB private FormB F1 = null; public FormCustomerOldAddUpdate(FormA a) { InitializeComponent(); F1 = a; } private void BtnSave_Click(object sender, EventArgs e) { DataTable dt = this.F1.dgvList.DataSource as DataTable; DataRow rw = dt.NewRow(); rw[0] = txtName.Text; rw[1] = txtLike.Text; dt.Rows.Add(rw); }FormB中的数据就是无法添加到FormA 的DataGridView中 上面写错了如下:[Quote=引用 1 楼 power0227 的回复:]1 FormAprivate void tsbtnAdd_Click(object sender, EventArgs e) { FormB b= new FormB(this); b.show(); }FormB private FormA F1 = null; public FormCustomerOldAddUpdate(FormA a) { InitializeComponent(); F1 = a; }private void BtnSave_Click(object sender, EventArgs e) { DataTable dt = this.F1.dgvList.DataSource as DataTable; DataRow rw = dt.NewRow(); rw[0] = txtName.Text; rw[1] = txtLike.Text; dt.Rows.Add(rw); }FormB中的数据就是无法添加到FormA 的DataGridView中 如何实现QQ登录窗口上的那个combobox C# 线程的运用 缺少xc_pro11.msi文件 谁能给我一个支持多个主键并可以按任意字段排序的分页存储过程?急啊,谢谢! 正则表达式 抛出异常的同时,为什么自增字段还会+1? 小偷程序采集百度新闻的数据经常被封IP.请大家帮忙看看,万分感谢! 50分求解,请帮忙看一看! 请高手指教呀! 传入的表格格式数据流(TDS)远程过程调用(RPC)协议流不正确。参数 13 ("@ContractList"): 数据类型 0xE7 的数据长度或元数据长度无 C# 如何捕捉到数据库的外键插入异常 怎样用C#应用程序修改web.config配置文件
private void tsbtnAdd_Click(object sender, EventArgs e)
{
FormB b= new b(this);
b.show();
}FormB
private FormB F1 = null;
public FormCustomerOldAddUpdate(FormA a)
{
InitializeComponent();
F1 = a;
}
private void BtnSave_Click(object sender, EventArgs e)
{
DataTable dt = this.F1.dgvList.DataSource as DataTable;
DataRow rw = dt.NewRow();
rw[0] = txtName.Text;
rw[1] = txtLike.Text;
dt.Rows.Add(rw); }FormB中的数据就是无法添加到FormA 的DataGridView中
如下:
[Quote=引用 1 楼 power0227 的回复:]
1 FormA
private void tsbtnAdd_Click(object sender, EventArgs e)
{
FormB b= new FormB(this);
b.show();
}FormB
private FormA F1 = null;
public FormCustomerOldAddUpdate(FormA a)
{
InitializeComponent();
F1 = a;
}
private void BtnSave_Click(object sender, EventArgs e)
{
DataTable dt = this.F1.dgvList.DataSource as DataTable;
DataRow rw = dt.NewRow();
rw[0] = txtName.Text;
rw[1] = txtLike.Text;
dt.Rows.Add(rw); }FormB中的数据就是无法添加到FormA 的DataGridView中