Question

I want to add some data in grid to show user.

I want to use TDBGrid

How do I add any row to grid without a database?

Thank you

Was it helpful?

Solution

A TDBGrid reflects the data in an underlying dataset (query, clientdataset etc). To have new or changed data appear, update the data in the dataset (and/or maybe refresh it).

If you do not use an external database, your are still able to use e.g. a TClientDataSet and store its data to file (proprietary format or XML, depending on your Delphi version - see its documentation). Given the flexibility of using datasets (e.g. editing the data), I recommend this.

Alternatively, use a TstringGrid and store your data in any (other) way you want.

[It also depends on what else you want to do with the data once it's presented in the grid. If you want the user to be able to edit it, TClientDataSet is the way to go.]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top