Recent

Author Topic: DBGrid Editing Columns  (Read 3525 times)

jack

  • Full Member
  • ***
  • Posts: 107
DBGrid Editing Columns
« on: January 26, 2012, 09:26:25 pm »
Everything that I read says "Just double click on the grid and up will pop a window to choose a column and edit its characteristics"

Lovely except that my pop up window only offers to add columns, what have I missed?
« Last Edit: January 26, 2012, 09:41:04 pm by jack »

IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: DBGrid Editing Columns
« Reply #1 on: January 26, 2012, 11:10:59 pm »
Once you have added a column, that column and it's attributes will be available in the Object Inspector window.

In my app, it is in the following tree:
dBGrid1: TDBGrid
 - Columns: TDBGridColumns
     - 0 - col 1
     -  1 - col 2 (or the name you gave the column)

jack

  • Full Member
  • ***
  • Posts: 107
Re: DBGrid Editing Columns
« Reply #2 on: January 27, 2012, 05:18:37 am »
Wait, Light has dawned!

The default display just shows whatever is in the database.  If I want to redefine what is displayed, like change the order of the columns or the column heading etc.. I need to go through this edit columns process to create the code to rearrange things.

When I add with this tool I must then go to the object inspector for each of the added fields and define its new properties including what field to display and how to format the data.

Sorry, This will get easier as I get the drift of how things are done.
« Last Edit: January 27, 2012, 05:21:21 am by jack »

 

TinyPortal © 2005-2018