Is there any way to get underlying control for a DataGridView cell? I would like to attach normal texbox events to capture keystrokes and capture value changed.
So i
You can do it with the EditingControlShowing event
void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (e.Control is TextBox)
{
(e.Control as TextBox).KeyDown += new KeyEventHandler(Form1_KeyDown);
//add as you require
}
}
void Form1_KeyDown(object sender, KeyEventArgs e)
{
// your code here
}