DBGrid Problem -- SetFocus Limit

DBGrid Problem -- SetFocus Limit

Post by Neil Marshal » Fri, 18 Apr 1997 04:00:00


I have no problem to setfocus any related-database OCXs except
DBGrid.  The code fragement for setting a focus to the first
column in a data base grid (Apex):


When the code is compiled and run, the error message says "
No method or properties support for object."  Can you tell me
what code statement to set focus to any column in a db grid?

Thank you, Neil


DBGrid Problem -- SetFocus Limit

Post by Norman Leun » Sat, 19 Apr 1997 04:00:00

Just put:


will set the focus to the cell 0,0.


1. Fiddly fiddly .setfocus DBGrid and TForms

I am finding that when editing DBGrid, leaving the grid to another
TForm and returning to the DBGrid causes disruption to the DBGrid
highlight. It simply disappears until a key is pressed. This is very
confusing to an end user.

- This disappearing highlight happens especially
  when DBGrid.editormode=true.
- Toggling the dgAlwaysShowEditor option seems to
   cause this problems with the focus.
- The options are set to DgAlwaysShowSelection.
- The form containing DGGrid has the
  Form1.ActiveControl set to DBGrid1.

The only solution I can find is to do a 'dummy' BitBtn.setfocus and
immediate DBGrid.setfocus in OnActivate. This has to be done whenever
changing the dgAlwaysShowEditor option. Fortunately, this trick
"flicks" the highhight in DBGrid back on.

It works, but this is fiddly. Is that how Delphi is meant it to be?
Who knows a better way?

Emails appreciated. I will reply.

2. GA-ATLANTA-63033--Year 2000-Client/Server-NCR-UNIX-Windows NT-ORACLE-Progress-Co

3. DBGrid & SetFocus to a specific Column

4. True Sync

5. Another setfocus problem in VFP 3

6. Feedback for users during stored procedure execution

7. SetFocus problem with v3.0b

8. selecting object owner

9. FoxPro SetFocus to an Option Group problem

10. Problem with SetFocus()

11. SetFocus problem for a form

12. SetFocus problem with Option Groups

13. Problems with .SetFocus Property