如何清除DataGridView行 [英] How to clear DataGridView Rows

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

问题描述

我有一个DataGridview,它绑定到DataTable作为数据源
当我尝试使用
清除行时 dgvBillingDet.Rows.Clear();

我收到类似
的错误
无法清除列表;

请告诉我来解决.

在此先谢谢

I got a DataGridview which is bound to a DataTable as Datasource
when am trying to clear the rows using
dgvBillingDet.Rows.Clear();

I get an error Like

Cannot Clear The List;

pleas tell me hoe to solve it.

Thanks In advance

推荐答案

尝试一下.. :)

try this.. :)

gridView1.DataSource = null;
gridView1.DataBind();



如何在c#中清除datagridview [



how to clear datagridview in c#[^]


这篇关于如何清除DataGridView行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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