PC Review


Reply
Thread Tools Rate Thread

DataGrid Control Selected Index

 
 
=?Utf-8?B?Q2hyaXM=?=
Guest
Posts: n/a
 
      20th Jan 2005
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
 
Reply With Quote
 
 
 
 
MajorTom
Guest
Posts: n/a
 
      20th Jan 2005
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

"Chris" <(E-Mail Removed)> wrote in message
news:926A538B-403A-4FC6-A41F-(E-Mail Removed)...
> 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



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get the index selected in the datagrid table anant Microsoft ADO .NET 1 17th Oct 2006 09:33 AM
if I have a datagrid, how can i do the selectedindexchange on the selected index on that datagrid?? Jason Microsoft Dot NET Framework Forms 1 17th Oct 2003 01:46 PM
Retrieving data table index for datagrid index selected Dvae c Microsoft Dot NET Compact Framework 2 5th Oct 2003 01:43 PM
Re: Finding the new index of a selected row after Re-sort on a DataGrid. One Handed Man Microsoft ADO .NET 1 27th Aug 2003 02:51 PM
Datagrid dropdownlist selected index changed Julie Barnet Microsoft ASP .NET 0 20th Aug 2003 06:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:59 AM.