Recent

Author Topic: Are there any friendly grid controls?  (Read 27858 times)

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Are there any friendly grid controls?
« Reply #30 on: September 26, 2012, 01:03:21 am »
Also, in my line of work it seems - unless I'm wrong - that data-aware controls are too simplistic for my needs. We don't use simple forms of the variety where you have buttons for Previous/Next, insert,delete etc. (which is usually what the examples show).

That's not true, You don't have to use them like that.
You can create a tsqlquery which is a tdataset, then you can "fill" it by calling the open method, you don't have to bind it to anything if you don't want to.  You can also use it to execute sql, it covers both bases.
If you call open and have a select statement in the SQL property it acts like a table which you can bind using a datasource to a grid or databound compoents like a tdbmemo, or you can simply access the data manually.  If you want it to just exec some sql you call mydataset.execsql.

The other advantage to using the DBgrid is it is optimized to work with the Tdataset descendents so it only pulls the data that is going to be shown on the screen, and as you scroll it contains just the data on the screen.
As far as I know the tstringgrid is not optimized like that for displaying large result sets.
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

 

TinyPortal © 2005-2018