0
private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
{
if (dataGridView1.CurrentCell.ColumnIndex==0)
{
dataGridView1.BeginEdit(true);
comboBox1.Visible = true;
comboBox1.Location = dataGridView1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true).Location;
comboBox1.Size = dataGridView1.CurrentCell.Size;
comboBox1.Focus();
}
}
操作不工作把System.Windows.Form.ComboBox中的DataGridView和在上面的代碼組合框下拉財產鍵盤
_not working_是什麼意思?你得到任何異常或錯誤信息? – 2014-10-27 08:49:52
沒有錯誤,組合框下拉不擴展 – Ranjeet 2014-10-27 09:37:10
(http://stackoverflow.com/questions/26583829/put-the-system-windows-form-combobox-in-datagridview-operate-by-keyboard)這個鏈接包含完整的代碼我寫了 – Ranjeet 2014-10-27 09:38:14