RE: Cannor capture DEL key in DataGrid event



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?
> >
.



Relevant Pages

  • RE: Threads.
    ... "Mark R. Dawson" wrote: ... > you can use Revents to indicate that all worker threads have finished ... > Here is an example of three worker threads being run by the main UI thread, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Finding "not used methods"
    ... Mark R. Dawson wrote: ... > Hi Anders, ... >> extensive but very poor documented business layer. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: WinForm Resize
    ... "Mark R. Dawson" wrote: ... > visual redraw when you resize the form. ... >> When I resize de window by dragging it's border it is very slow to rearrange ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Display results from a DataGrid in labels
    ... Sorry Mark, ... also appear in corresponding labels else on the form. ... >>I have a datagrid containing data from an xml file. ... > column that underlies the grid. ...
    (microsoft.public.data.ado)
  • RE: Any possible way?
    ... is there any way I can hide a row programatically in the datagrid? ... The thing I want to achive is to mark deleted row somehow. ... Custom arrary objects is bound to datasource in datagrid... ... as long as the I can keep the state of the underlying data structure.. ...
    (microsoft.public.dotnet.framework.compactframework)