Εμφάνιση αναρτήσεων με ετικέτα Tables. Εμφάνιση όλων των αναρτήσεων
Εμφάνιση αναρτήσεων με ετικέτα Tables. Εμφάνιση όλων των αναρτήσεων

Κυριακή 4 Μαρτίου 2012

Alternate DBGrid Row Color

You've seen this surely on web pages. Alternating table row colors means displaying the first record in one color and the second record in another color and continue to alternate the color of each row displayed.
When working with datasets with many rows, alternating the background color of each row can increase readability.

Sorting records in Delphi DBGrid by Clicking on Column

How to sort records in Delphi DbGrid by clicking on the column title. plus how to change the appearance of the selected column title to reflect the sort order. Even more: how to change the cursor when moving over the DBGrid column titles.
The examples below use ADO components (AdoQuery/AdoTable connected to ADOConnection, DBGrid connected to AdoQuery over DataSource) to display the records from a database table in a DBGrid component. All the component names were left as Delphi named them when dropped on the form (DBGrid1, ADOQuery1, AdoTable1, ...).