DataGrid Control Selected Index

G

Guest

Hello,

I am using a DataGrid control to populate an all customers list. I would
like the users to be able to scroll up or down the list press Enter and the
customer record populate on another form. I am able to accomplish this only
with the Click Event, and it only works if you Click the Row Indicator on the
far left side of the DataGrid.

The problem seems to be realed to the cells of the DataGrid having focus at
the time when the Enter key is pressed. I've tried using the
CurrentCellChanged event and still cannot get the KeyUp Event to fire.

Is there anyway to accomplish this? I would rather cell browsing not be
available to the users and the DataGrid's RowIndicator to all ways have focus.

Any Help is appreciated.

Thank you
 
M

MajorTom

I use somethink like this:
private CurrencyManager cm1;
..
..
..
cm1 = (CurrencyManager) BindingContext[dvCargos];
..
..
..
CurrentCellChanged event and still cannot get the KeyUp Event to fire.
remenber KeyPreviw = true for the form
..
..
..
and for any row position change you can use:
cm1.PositionChanged -= new EventHandler(cm1_PositionChanged);

Ask if you need more

MajorTom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top