如何在单击“保存”按钮后清除数据网格值 [英] How to clear datagrid values after click save button

查看:67
本文介绍了如何在单击“保存”按钮后清除数据网格值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好如何在保存按钮崩溃后清除Windows应用程序中的数据网格值





dgv.rows.clear();

无法工作



请帮助我

解决方案

更改此DataGridView的数据源for null或empty datatable。



 DataGridView1.DataSource =  null ; 





更多信息: http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.datasource%28v=vs.85% 29.aspx [ ^ ]


这将清除您的网格



DataGridView1 .DataSource = null;

DataGridView1.DataBind()

http://stackoverflow.com/questions/11561680/deleting-all-the-data-from-a-datagridview

Hi How to clear datagrid values in Windows application after save button clcked


dgv.rows.clear();
not working

pls help me

解决方案

Change the datasource for this DataGridView for null or empty datatable.

DataGridView1.DataSource = null;



More at: http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.datasource%28v=vs.85%29.aspx[^]


This will clear your grid

DataGridView1.DataSource = null;
DataGridView1.DataBind()


http://stackoverflow.com/questions/11561680/deleting-all-the-data-from-a-datagridview


这篇关于如何在单击“保存”按钮后清除数据网格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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