Fiddly fiddly .setfocus DBGrid and TForms

Fiddly fiddly .setfocus DBGrid and TForms

Post by Matth » Mon, 16 Sep 1996 04:00:00



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.
Matthew.

 
 
 

1. DBGrid & SetFocus to a specific Column

DBGrid & SetFocus to a specific Column

When navigating through a dbgrid using TabKey and or arrows, how can I set
the Focus to a specific Column ?

Something like

DBGrid1_OnNavigate(Colindex as integer)
If Colindex = 1 then
   DBGrid1.Columns(2).SetFocus
End if

This is to avoid the selection of cells that are not editable...

Thanks,
Phil

2. Replication monitoring & recovery

3. DBGrid Problem -- SetFocus Limit

4. UP - update processor in D3

5. SetFocus in Datagrid?

6. SQL DMO BulkCopy in C++

7. SetFocus problem with Option Groups

8. 6.4/06 - volatile Btree corruption

9. how to highlight after setfocus ???

10. SetFocus and Move on DBColumns ?

11. .LostFocus/.SetFocus problem

12. Setfocus and "beeping"

13. ListBox with style CheckBox setfocus