如何删除datagridview的结构 [英] how to delete the structure of a datagridview
本文介绍了如何删除datagridview的结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我有一个3列的datagrid.我想通过单击一个按钮删除网格的当前结构(表示所有列).
我尝试了以下一个
Hi
am having a datagrid with 3 columns. i want to delete the current structure of the grid(means all the columns) in a single button click.
I tried the below one
dgv_show.Columns.Clear();
清除网格中的所有行而不是列
任何机构都可以帮助我解决此问题
it clear all the rows in grid not columns
Any body please help me to solve this
推荐答案
尝试一下,
Try this,
GridViewID.DataSource =null;
GridViewID.DataBind();
try this
datatable1.columns.clear
这篇关于如何删除datagridview的结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文