Designed to enable a user to view and edit data in a tabular grid, the TDBGrid component provides various ways of customizing its appearance.
With so flexible component, a Delphi developer can always find new ways to make data more attractive.
Κυριακή 4 Μαρτίου 2012
Coloring DBGrid
Adding color to your
database grids will enhance the appearance and differentiate the
importance of certain rows or columns within the database.
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, ...).
Παρασκευή 2 Μαρτίου 2012
Recover the ID of the last inserted row in a table (ADO)
Learn how to recover the ID of the last inserted row in a MSSQL Server Table
Εγγραφή σε:
Αναρτήσεις (Atom)