You can handle the QueryInputKey event on the Column’s CellEditorManager :
foreach( Column col in gridControl1.Columns )
{
col.CellEditorManager.QueryInputKey +=
new QueryEditorInputKeyEventHandler(CellEditorManager_QueryInputKey);
}
void CellEditorManager_QueryInputKey( object sender, QueryEditorInputKeyEventArgs e )
{
System.Diagnostics.
Debug.WriteLine( e.KeyData.ToString() );
}
Note however that when a key is press to enter edition (instead of a mouse click), the first key will not be processed by this event, so you need to handle the KeyPress on the cell itself to get the first key :
foreach( Cell cell in dataRowTemplate1.Cells )
{
cell.KeyPress +=
new KeyPressEventHandler( cell_KeyPress );
}
void cell_KeyPress( object sender, KeyPressEventArgs e )
{
System.Diagnostics.
Debug.WriteLine( e.KeyChar.ToString() );
}
Imported from legacy forums. Posted by André (had 803 views)