Form key events are not raised when you type in a DataGrid cell with the KeyPreview property set to true (815252)
The information in this article applies to:
- Microsoft .NET Framework 1.0
- Microsoft .NET Framework 1.1
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
SYMPTOMSWhen you set the KeyPreview property of the form to True, and you type
in the cell of a DataGrid control, the Key events of the form (KeyUp, KeyDown) do not raise. However, when you press any key while focus is on
the title, the column, or the lines of the DataGrid, the Key events of the form are raised as expected.
CAUSEWhen the DataGrid cell has input focus, the Key events that
were passed to the DataGrid control are first assigned to the DataGrid cell event handlers.
The DataGrid cell does not support any Key events. The Key events are not
enabled in the DataGrid to allow users to navigate inside the DataGrid control by using the keyboard. Therefore, Key events are not
passed from the DataGrid cell to the parent Windows form, and the parent form
Key event does raise.STATUS This
behavior is by design.
Modification Type: | Major | Last Reviewed: | 1/25/2006 |
---|
Keywords: | kbvs2005swept kbvs2005doesnotapply kbControl kbWindowsForms kbEvent kbProgramming kbprb KB815252 kbAudDeveloper |
---|
|