1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
DataGridViewRow dataGridRow = new DataGridViewRow();
DataGridViewCell[] cells = new DataGridViewCell[2];
//DataGridViewTextBoxCell txt2A = new DataGridViewTextBoxCell();
DataGridViewComboBoxCell cbo1 = new DataGridViewComboBoxCell();
cbo1.Items.Add("Item one");
cbo1.Items.Add("Item two");
cbo1.Items.Add("Item three");
// Set the displayed value.
// This value needs to be present
// in the items collection
cbo1.Value = cbo1.Items[0];
cbo1.ReadOnly = false;
//txt2A.Value = "a combobox";
//dataGridRow.Cells.Add(txt2A);
//txt2A.ReadOnly = true;
dataGridRow.Cells.Add(cbo1);
dataGridRow.Height = 20;
dataGridViewFinding.Rows.Add(dataGridRow); |