DataGrid - Catching backspace key click before its processed.
From: Colin Jack (colin.jack_at_ed.tadpole.com)
Date: 07/08/04
- Next message: Grecko: "Insert problem !!"
- Previous message: Miha Markic [MVP C#]: "Re: Dataset/Datareader and filter"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 8 Jul 2004 10:34:41 +0100
Hi,
I am trying to catch the user clicking the backspace key, Keys.Back. I need
to do this as I cant allow the datagrid to add a new blank row when the user
clicks the backspace key whilst they are in the last row in the grid, if the
row is also empty. Anyway I've derived my own custom control from the
DataGrid and want to pre process the backspace key. However I've found that
I'm not catching the backspace with any of these overrides:
public override bool PreProcessMessage(ref Message msg)
protected override bool ProcessKeyMessage(ref Message m)
protected override bool ProcessKeyEventArgs(ref Message m)
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
protected override bool ProcessDialogKey(Keys keyData)
protected override bool ProcessKeyPreview(ref System.Windows.Forms.Message
msg)
The problem is none of these methods is getting called when I click the
backspace, it seems like the DataGrid is immediately processing it. I'm a
little confused over this as I also needed to handle the Delete key,
Keys.Delete. I managed to do this as the ProcessKeyPreview is raised when
the user clicks the Delete key so I have no idea why it isnt raised for the
backspace key.
Anyone got any suggestions?
Ta,
Colin Jack
- Next message: Grecko: "Insert problem !!"
- Previous message: Miha Markic [MVP C#]: "Re: Dataset/Datareader and filter"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|