Hi again Rajagopal,
Ack! I don''t want to go the override route yet if I don''t have to. I went down that road with half the controls in System.Windows.Forms. But I thought of a different way that may work:
I''m going to define a KeyUp event handler for the form itself to capture the F8. If the ActiveControl is the Grid (or more likely one of the Grid controls like a Grid TextBox or whatever), I''m going to then check the column index on the CurrentCell to see if it is my lookup column. If it is, I''ll proceed from there.
Your thoughts?
>Hi Rich,
You can try handling the CurrentCellKeyPress event, this gets fired for every keystroke in a cell. To catch the functionkeys, CurrentCellKeyDown event can be handled, but this will not fire when the cell is in edit mode. So, to catch the functionkeys whether or not a cell is being edited, you can derive the grid and override ProcessCmdKey.
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.F8)
{
Console.WriteLine("Function Key F8 pressed");
return true;
}
return base.ProcessCmdKey (ref msg, keyData);
}
private void gridControl1_CurrentCellKeyPress(object sender, KeyPressEventArgs e)
{
Console.WriteLine( e.KeyChar );
}
Let me know if you have any further questions.
Regards,
Rajagopal