Recent

Author Topic: DBGrid columns question  (Read 3103 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2258
    • Lazarus and Free Pascal italian community
DBGrid columns question
« on: October 11, 2011, 11:41:44 am »
Question: in a DBGrid, you can add one or more columns that are not part of the datasource? In order to use them as variables of support? If you explain to me how? You can also change the order of the columns from code? Without going to work on the query? thanks
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

goodname

  • Sr. Member
  • ****
  • Posts: 297
Re: DBGrid columns question
« Reply #1 on: October 11, 2011, 02:54:41 pm »
Double clicking on the DBGrid in development will bring up a display where you can add, remove, edit title, and change the display order of columns. Have never tried to display something that was not in the query.

99Percent

  • Full Member
  • ***
  • Posts: 160
Re: DBGrid columns question
« Reply #2 on: October 12, 2011, 04:17:00 am »
You will need to use a datasource anyway. What I usually do in these cases is use a in-memory dataset like TMemDataSet or TRxMemoryData copy the data from a query dataset and then add the fields programatically.

 

TinyPortal © 2005-2018