This article will show you a way to display different hints in TStringGrid cells at runtime.
Εμφάνιση αναρτήσεων με ετικέτα DBGrid. Εμφάνιση όλων των αναρτήσεων
Εμφάνιση αναρτήσεων με ετικέτα DBGrid. Εμφάνιση όλων των αναρτήσεων
Τετάρτη 8 Μαΐου 2013
Παρασκευή 11 Μαΐου 2012
Adjusting DBGrid column widths automatically
Here's
a handy method to automatically fix the size of TDBGrid columns (at
run-time) to fit the DBGrid width (remove the unfilled space at the
right edge of the grid; and consequently remove the horizontal scroll
bar) when the user resizes the container containing the grid.
Master-detail relationships ADO and Delphi
Using two TTable or TQuery descendats to create master-detail database entry forms.
Get the line number of a selected row in a DBGrid
If you want to get the line number of a selected row in a DBGrid
component, here's what to do... Note: just substitute the Table1
component for whatever dataset you are using to provide data to your
DBGrid.
~~~~~~~~~~~~~~~~~~~~~~~~~
ShowMessage(IntToStr(Table1.RecNo)) ;
~~~~~~~~~~~~~~~~~~~~~~~~~
ShowMessage(IntToStr(Table1.RecNo)) ;
~~~~~~~~~~~~~~~~~~~~~~~~~
Prevent CTRL+DELETE in DBGrid
If you need to disable keyboard delete operation inside a DBGrid you'll need to disable the CTRL+DELETE key press.
How to make the Enter key work like Tab
We know that, generally, pressing the Tab key moves the input focus to
next control and Shift-Tab to previous in the tab order of the form.
When working with Windows applications, most users intuitively expect
the Enter key to behave like a Tab key.
How to Display Only Selected Fields in the DbGrid Component
See how use the Fields
Editor to define a list of some of the fields in a table that are to be
displayed in the Grid. Even more: see how to specify the field order.
How to Create a Simple Database Display Form
General instructions
for setting up a Table, DataSource and DbGrid component at design time
in order to access the data encapsulated by a table component.
Κυριακή 4 Μαρτίου 2012
Drawing an image in a cell of a Delphi DBGrid
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.
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
Εγγραφή σε:
Αναρτήσεις (Atom)