Re: Arrowkeys in datagrid

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 03/11/04


Date: Thu, 11 Mar 2004 09:25:03 -0500

Lasse,

    Yes, it does. The CurrentCellChanged event is what you want to
subscribe to.

-- 
               - Nicholas Paldino [.NET/C# MVP]
               - mvp@spam.guard.caspershouse.com
"Lasse Edsvik" <lasse@nospam.com> wrote in message
news:eyiaiO3BEHA.1452@TK2MSFTNGP09.phx.gbl...
> Nicholas,
>
> hmm, is there an OnChange event or something like that?
>
> /Lasse
>
>
> "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote
in
> message news:OYtdt%232BEHA.3404@TK2MSFTNGP10.phx.gbl...
> > Lasse,
> >
> >     Instead of using the mouse up event, and the key up or key down
event,
> > why not detect when the cell has changed?  When the cell changes, just
> > select the full row that the cell is in.  This would handle both
keyboard
> > and mouse changes.
> >
> >     Hope this helps.
> >
> >
> > -- 
> >                - Nicholas Paldino [.NET/C# MVP]
> >                - mvp@spam.guard.caspershouse.com
> >
> > "Lasse Edsvik" <lasse@nospam.com> wrote in message
> > news:%23zXVKn2BEHA.3472@TK2MSFTNGP09.phx.gbl...
> > > Hello
> > >
> > > I was wondering if there is a way to select a row in a datagrid if you
> > > navigate in it using arrowkeys.
> > >
> > > i have this onMouseUp, should do the same with arrowkeys:
> > >
> > > System.Drawing.Point pt = new Point(e.X, e.Y);
> > >
> > > DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt);
> > >
> > >
> > > if(hti.Type == DataGrid.HitTestType.Cell)
> > >
> > > {
> > >
> > > dataGrid1.CurrentCell = new DataGridCell(hti.Row, hti.Column);
> > >
> > > dataGrid1.Select(hti.Row);
> > >
> > >
> > > }
> > >
> > >
> >
> >
>
>