C# How to bind DataTable columns to DataGridView manually

image

dt = new DataTable();
dt.Columns.Add("Reference", typeof (string));
dt.Columns.Add("Version", typeof(string));
dt.Columns.Add("LatestVersion", typeof(string));
//5. Set AutogenerateColumns to false
dataGridView1.AutoGenerateColumns = false;
dataGridView1.DataSource = dt;

Comments

Popular posts from this blog

Tibco Rendezvous (tibrv) C# .Net example

Parse XML to dynamic object in C#