PC Review


Reply
Thread Tools Rate Thread

How do I trap and/or replace the Enter key within the DataGridView

 
 
B. Chernick
Guest
Posts: n/a
 
      7th Oct 2008
How do I trap and/or replace the Enter key within the DataGridView while in
an editing field?

I have a bound grid with add enabled (VB/Dot Net 2.0). When I'm in the Add
Line (if that's the correct term) the first cell is temporarily set to
ReadOnly=False so the user can enter a search key. The user then Tabs to the
2nd cell in which a lookup within the CellEnter event takes the key and does
a search, sometimes generating a popup. Once a value is selected from the
popup, the record is completed and added to the grid. TABs work fine but an
Enter always cancels the Add and sends the cursor back to the last record of
the grid.

If this sounds like improvisation, it is. I've created this through trial
and error. This is supposed to be a simple data entry/editing program for
people accustomed to Excel. So far I have been unable to find a scenario
close to this in any on-line sample. (I need to be able to intuitively
add/edit/delete within the grid, without resorting to external buttons for
anything other than the final mass update to the database.)
 
Reply With Quote
 
 
 
 
B. Chernick
Guest
Posts: n/a
 
      9th Oct 2008
May as well forget this one as well. I've disabled Add and used a popup
dialog instead. The key events were just too much trouble.

"B. Chernick" wrote:

> How do I trap and/or replace the Enter key within the DataGridView while in
> an editing field?
>
> I have a bound grid with add enabled (VB/Dot Net 2.0). When I'm in the Add
> Line (if that's the correct term) the first cell is temporarily set to
> ReadOnly=False so the user can enter a search key. The user then Tabs to the
> 2nd cell in which a lookup within the CellEnter event takes the key and does
> a search, sometimes generating a popup. Once a value is selected from the
> popup, the record is completed and added to the grid. TABs work fine but an
> Enter always cancels the Add and sends the cursor back to the last record of
> the grid.
>
> If this sounds like improvisation, it is. I've created this through trial
> and error. This is supposed to be a simple data entry/editing program for
> people accustomed to Excel. So far I have been unable to find a scenario
> close to this in any on-line sample. (I need to be able to intuitively
> add/edit/delete within the grid, without resorting to external buttons for
> anything other than the final mass update to the database.)

 
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 trap <Ctrl+Tab> is DataGridView John B. Microsoft Dot NET Framework Forms 2 3rd Jan 2008 08:21 PM
How to trap <Ctrl+Tab> is DataGridView John B. Microsoft C# .NET 2 3rd Jan 2008 08:21 PM
Help to trap Datagridview cell keypress events... profdotnet Microsoft Dot NET Framework Forms 1 14th Jun 2007 04:22 PM
Help to trap Datagridview cell keypress events... profdotnet Microsoft Dot NET Framework 0 25th Apr 2007 06:47 PM
Which event can help me trap when datagridview column size changes? DBC User Microsoft C# .NET 1 25th Nov 2006 07:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:36 PM.