如何在DataGridView中释放绑定C# [英] how to release binding in DataGridView c#

查看:87
本文介绍了如何在DataGridView中释放绑定C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在DataGridView C#窗口应用程序中释放绑定,请单击按钮.
当我再次单击该按钮时,会出现错误:-这将导致集合中的两个绑定绑定到相同的属性.
参数名称:binding

how to release binding in DataGridView c# window application click on button.
when i click on the button again it give error:- This causes two bindings in the collection to bind to the same property.
Parameter name: binding

推荐答案

您可以通过两种方式执行此操作:

1)您可以将DataGridView的DataSource属性设置为null

2)您可以清除DataGridView上的DataBindings,如下所示:
There are two ways you could do this:

1) You can set the DataSource property of the DataGridView to null

2) You can clear the DataBindings on the DataGridView as follows:
dataGridView1.DataBindings.Clear();



希望对您有所帮助:-)



Hope it helps :-)


这篇关于如何在DataGridView中释放绑定C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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