DBGrid problem- withou 
Author Message
 DBGrid problem- withou

TS>I have a problem with the DBGrid component:

TS>When the BBGrid options are set to  dgEditing=FALSE  or  dgRowSelect=TRUE
TS>and the DBGrid has focus - then pressing the accelerator  key for any button
TS>on the form WITHOUT pressing the ALT key activates the buttons OnClick event

TS>This probably was a (questionable) design decision rather than a BUG in the
TS>DBGrid but I cannot afford to have this behavior in my app. My DBGrid is for
TS>viewing only - but typing alphanumeric keys causes incremental searches to
TS>occur on the table that the grid is attached to. I want to have
TS>dgRowSelect=TRUE in order to have an obvious visual cue as to the current
TS>record. I solved this problem (initially) by using a boolean variable to sto
TS>the shift state (whether the ALT key was pressed) and use this variable to
TS>override the OnClicks of the buttons. But now I have a new problem: I need t
TS>pass the onKeyDown event of the grid to a couple of other controls and this
TS>also fails when the accelerator keys are pressed (the event is obviously
TS>re-directed to the buttons before I can get to it).

Interesting problem. I tried this with an simple application, and
experienced similar functionality. Only an API solution comes into mind:
have you tried to subclass the grid? Process the WM_KEYDOWN message sent
to the grid, and call the previous message handler only if the Alt key
is down. Otherwise, do your own searching.

Regards,

Jani

--
---------------------------------------------------------------------

Check out Help Editor 2.0 for Windows at:
ftp://ftp.mpoli.fi/metropoli/windows/utils/hlped20.zip

1996: Only four years to computer confusion!
What have you done to avoid it?
---------------------------------------------------------------------
---
 * SLMR 2.1a *



Mon, 24 Aug 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. DBGrid problem - difficult problem

2. DBGrid missing gridlines problem

3. Problem with DBGrid visible/unvisible *********

4. DBGrid problem

5. DBgrid problem....

6. edit problem with dbgrid and a query

7. Simple DBGrid Row Selection Problem - Revised

8. Simple DBGrid Row Selection Problem

9. DBGrid problem

10. dbGrid/dataSource problem

11. sql and DBGrid problem

12. Problem with DBGrid

 

 
Powered by phpBB® Forum Software