我怎样才能刷新C#的dataGridView更新后? [英] How can I refresh c# dataGridView after update ?

查看:1260
本文介绍了我怎样才能刷新C#的dataGridView更新后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个DataGridView,当我点击一个表单打开更新的行数据的任何行,但截至更新的更新形式被关闭,但在DataGridView不更新数据后

I have a dataGridView when I click on any row a form is opened to update the row data, but after ending updates the updating form is closed but the dataGridView data is not updated

我怎样才能做到这一点?

How can i do that ?

推荐答案

重新绑定您的datagridview到源。

Rebind your DatagridView to the source.

DataGridView dg1 = new DataGridView();
dg1.DataSource = src1;

// Update Data in src1

dg1.DataSource = null;
dg1.DataSource = src1;

这篇关于我怎样才能刷新C#的dataGridView更新后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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