> Hi!
> I having two DataGridViewComboBox columns in a datagridview. I am trying to
[quoted text clipped - 5 lines]
> Regards,
> Raj
Hi,
You can do it by override the onCellClick on the DataGridView and then call
BeginEdit.
This will get the DateGridview to load the edit control for the selected cell.
Then you can get the current EditControl from the DataGridView control and
then you can set the DroppedDown property to true. Of cause only if the
column is a DataGridViewComboboxColumn so check for that that first.
Example:
private void dataGridView1_CellClick(object sender,
DataGridViewCellEventArgs e)
{
if (dataGridView1.Columns[e.ColumnIndex].Name == "YourColumnName")
{
dataGridView1.SelectionMode = DataGridViewSelectionMode.CellSelect;
dataGridView1.BeginEdit(true);
DataGridViewComboBoxEditingControl comboboxEdit =
(DataGridViewComboBoxEditingControl)dataGridView1.EditingControl;
comboboxEdit.DroppedDown = true;
}
}
Regards
Rasmus
Raj Kumar - 07 Jun 2006 14:47 GMT
Sorry for responding so late. I had given up on getting a response back.
Thanks for the code snippet. I may have to extend it or make it generic so
that this behavior is available with keyboard navigation as our application
users tend to use the keyboard quite more than the mouse.
Regards,
Raj
> > Hi!
> > I having two DataGridViewComboBox columns in a datagridview. I am trying to
[quoted text clipped - 32 lines]
> Regards
> Rasmus