I
Ira
HI guys, I have a problem with adding a combo to a datagridview.
Here is my script:
dataGridView2.Columns.Clear();
PortTable = new DataTable();
PortTable.Columns.Add("Column1").DataType = typeof(string);
PortTable.Columns.Add("Column2").DataType = typeof(string);
PortTable.Columns.Add("Column3").DataType = typeof(string);
PortTable.Clear();
dataGridView2.DataSource = null;
newRow["Column1"] ="1";
newRow["Column2"] = "2";
DataGridViewComboBoxColumn comboboxColumn = new
DataGridViewComboBoxColumn();
comboboxColumn.DataPropertyName = "ptitle";
comboboxColumn.HeaderText = "Column3";
comboboxColumn.Items.Add("1");
comboboxColumn.Items.Add("2");
comboboxColumn.Items.Add("3");
????How could I add this combo to the datagrid with these items????
PortTable.Rows.Add(newRow);
dataGridView2.DataSource = PortTable;
Any help appreciated
Here is my script:
dataGridView2.Columns.Clear();
PortTable = new DataTable();
PortTable.Columns.Add("Column1").DataType = typeof(string);
PortTable.Columns.Add("Column2").DataType = typeof(string);
PortTable.Columns.Add("Column3").DataType = typeof(string);
PortTable.Clear();
dataGridView2.DataSource = null;
newRow["Column1"] ="1";
newRow["Column2"] = "2";
DataGridViewComboBoxColumn comboboxColumn = new
DataGridViewComboBoxColumn();
comboboxColumn.DataPropertyName = "ptitle";
comboboxColumn.HeaderText = "Column3";
comboboxColumn.Items.Add("1");
comboboxColumn.Items.Add("2");
comboboxColumn.Items.Add("3");
????How could I add this combo to the datagrid with these items????
PortTable.Rows.Add(newRow);
dataGridView2.DataSource = PortTable;
Any help appreciated