Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Delete Column in DataGridView

0.00/5 (No votes)
25 Nov 2015 1  
How to Delete Columns in a DataGridView

Introduction

This Article show you, how you can delete the Columns in a Datagridview 

Background

I had search long time to know how to clear the Columns in a DataGridView but i had not found some solution

Using the code

DataTable newTable = new DataTable("TEST");
DataTable.ReadXML("TEST.xml");
dataTablefromYesterday.Rows.OfType<DataRow>().ToList().ForEach(r =>
    {
        r["Gesamtstunden"] = DBNull.Value;
        r["Anfangszeit"] = DBNull.Value;
        r["Endzeit"] = DBNull.Value;
    });

C#

History

Keep a running update of any changes or improvements you've made here.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here