RE: Cannor capture DEL key in DataGrid event
- From: "Zest4Csharp" <Zest4Csharp@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 10 Aug 2005 22:34:02 -0700
Yes it sure does help. Many thanks to you for your kind assistance Mark.
--
Zest
"Mark R. Dawson" wrote:
> Hi Zest4Csharp,
>
> you could use the DataGrid as a baseclass, inherit from it and then override
> the ProcessCmdKey method, for example:
>
> class MyDataGrid : DataGrid
> {
> public MyDataGrid() : base()
> {
> }
>
> protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
> {
> if(keyData == Keys.Delete)
> {
> //do processing for delete
>
> //return true to stop the event being raised and deleting
> return true;
> }
>
> return base.ProcessCmdKey(ref msg, keyData);
> }
> }
>
>
>
> Hope that helps
> Mark R Dawson
>
>
> "Zest4Csharp" wrote:
>
> > I am trying to capture when the user clicks the DEL key on the keyboard for
> > me to grab the row index on a datagrid. I am running out of ways to do this.I
> > have tried ...
> >
> > private void dataGrid1_KeyDown(object sender,
> > System.Windows.Forms.KeyEventArgs e)
> > {
> > MessageBox.Show("I am here");
> > }
> >
> > And its not showing me the message box that i was expecting. I have also
> > tried _KeyUP and _KeyPress to no avail.
> >
> > Any suggestions?
> >
.
- References:
- Cannor capture DEL key in DataGrid event
- From: Zest4Csharp
- RE: Cannor capture DEL key in DataGrid event
- From: Mark R. Dawson
- Cannor capture DEL key in DataGrid event
- Prev by Date: How do I create my version of Microsoft Word
- Next by Date: RE: Newbie Qn - Interfaces as parameters and members
- Previous by thread: RE: Cannor capture DEL key in DataGrid event
- Next by thread: XML Help
- Index(es):
Relevant Pages
|