0
Answer

Datagrid Events

kendalgoodrich

kendalgoodrich

20y
1.8k
1
Hello everyone, I desperately need some help. I have added the following code to a datagrid test application: [code] this.dataGridTextBoxColumn1.TextBox.KeyUp += new System.Windows.Forms.KeyEventHandler(this.dataGrid1_KeyUp); this.dataGridTextBoxColumn2.TextBox.KeyUp += new System.Windows.Forms.KeyEventHandler(this.dataGrid1_KeyUp); this.dataGridTextBoxColumn1.TextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGrid1_KeyDown); this.dataGridTextBoxColumn2.TextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGrid1_KeyDown); this.dataGridTextBoxColumn1.TextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.dataGrid1_KeyPress); this.dataGridTextBoxColumn2.TextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.dataGrid1_KeyPress); [/code] I have found out that regular character keys trigger the keydown and keypress events in that order. The shift, control, caps lock buttons only trigger the keydown event. The keyup event is never triggered, Why??? The only time the arrow keys will trigger an event is when I click into one of the cells and move left or right between the characters with the arrow buttons. How can I trap the arrow keys navigating between cells of a datagrid and the enter key being pressed????? No events are triggered when I press the enter key. Can someone help me understand datagrid key events????? Thanks, kendal