C# How to bind DataTable columns to DataGridView manually
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
Post a Comment