Updating column titles in a DBGrid while DisableControls 
Author Message
 Updating column titles in a DBGrid while DisableControls

My application contains a TDBGrid with a TQuery as data provider.

When I execute the SQL SELECT statement in the TQuery, the DBGrid will
flicker, so I surround the SQL processing with
DisableControls/EnableControls. A part of the processing after the SQL
has executed, is to set column titles to something readable instead of
field names.

In delphi 4 it worked fine, if I put EnableControls just before the
assigning of titles. In Delphi 7 this fail to work, and the titles
remain as field names.

If I put Application.Processmesssages just before assigning titles, it
works, but reveal some of the stages where field names are shown.

Any suggestions?



Fri, 04 Nov 2005 00:34:52 GMT  
 Updating column titles in a DBGrid while DisableControls

Quote:

> In Delphi 4 it worked fine, if I put EnableControls just before the
> assigning of titles. In Delphi 7 this fail to work, and the titles
> remain as field names.

How about the standard Control refreshing methods, Refresh, Repaint
or Invalidate.  Don't they have any effect at all?


Fri, 04 Nov 2005 16:10:02 GMT  
 Updating column titles in a DBGrid while DisableControls

Quote:


> > In Delphi 4 it worked fine, if I put EnableControls just before the
> > assigning of titles. In Delphi 7 this fail to work, and the titles
> > remain as field names.

> How about the standard Control refreshing methods, Refresh, Repaint
> or Invalidate.  Don't they have any effect at all?

No, they have no effect. It seems like a queued message must be
processed before the assignment of titles, because when I insert
Application.ProcessMessages after the SQL statement is done it works -
but it's not a beaute. There must have been a change in D7 compared to
D4.

Regards,

Mikkel Andersen



Sat, 05 Nov 2005 04:35:47 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. DBGrid.Columns.Title.Caption problem.

2. How to wrap lines in column title

3. Update Memo-Column with SQL UPDATE Statement

4. DbGrid title row

5. More lines in Title of DBGrid or RXDbGrid

6. Title Row in DBGrid

7. DBGrid with muli-lines title ????

8. DBGrid title locking

9. Changing DBGrid Titles?

10. Q: Center DBGrid titles

11. How can I change Title of DBgrid?

12. DbGrid titles

 

 
Powered by phpBB® Forum Software