DataGridView problems
DataTable dt =new DataTable(); dt.Columns.Add(new DataColumn("option1",typeof(bool))); dt.Columns.Add(new DataColumn("option2",typeof(bool))); dt.Columns.Add(new DataColumn("TableName",typeof(string))); DataRow dr; foreach (TableSchema tsin creator.DBSchema.TableSchemas) { dr = dt.NewRow(); dr["option1"] =false; dr["option2"] =false; dr["TableName"] = ts.TableName; dt.Rows.Add(dr); } this.dataGridView1.DataSource = dt; |
I should mention that I've already set the DataPropertyName for each column to their corresponding string values in the designer.
I run the program and when the form loads the DataGridView decides to disregard the columns I've designed and it implements it's own hideous column layouts when I assign it a DataSource. I've read the docs and sifted through the seemingly ludicrous number of "Auto" settings for the DataGridView and it's columns, but I can't figure out why this behavior is occuring.

