I have a DataGridView
and I am populating it through a DataTable
. On initializing, I add DataColumns
to the DataTable
and then set the DataSource
of the DataGridView to the DataTable. Here is the code:
DataTable mTable = new DataTable("Test");
DataColumn col = new DataColumn;
col.DataType = System.Type.GetType("System.Boolean");
col.ColumnName = "First";
col.ReadOnly = false;
mTable.Columns.Add(col);
col = new DataColumn;
col.DataType = System.Type.GetType("System.String");
col.ColumnName = "Second";
col.ReadOnly = false;
mTable.Columns.Add(col);
this.myGridView.DataSource = mTable;
This works fine however, I want to make one of the columns showup as a combobox. I think I have to do something with the Column's datatype but I am not sure how to do this. Can anyone give me any pointer towards this?