DataGridViewComboBoxColumn的使用
DataGridViewComboBoxColumn ComboBoxColumn = new DataGridViewComboBoxColumn();
ComboBoxColumn.DataSource = Datatable对象(combobox要绑定的数据,包含两个列一个DisplayMember ,
ComboBoxColumn.DataSource = Datatable对象(combobox要绑定的数据,包含两个列一个DisplayMember ,
一个ValueMember )
ComboBoxColumn.DisplayMember = "Display";
ComboBoxColumn.ValueMember = "Value";
ComboBoxColumn.DataPropertyName = "Feild";//datagridview1的DataSource,数据库中的列
ComboBoxColumn.HeaderText = "单据种类";
ComboBoxColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing;
ComboBoxColumn.FlatStyle = FlatStyle.System;
this.datagridview1.Columns.Add(ComboBoxColumn);
ComboBoxColumn.ValueMember = "Value";
ComboBoxColumn.DataPropertyName = "Feild";//datagridview1的DataSource,数据库中的列
ComboBoxColumn.HeaderText = "单据种类";
ComboBoxColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing;
ComboBoxColumn.FlatStyle = FlatStyle.System;
this.datagridview1.Columns.Add(ComboBoxColumn);