#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    42
    Rep Power
    2

    IS there any way to set DBGrid.Columns property with coding ?


    When DBGrid is placed on the form at Object Inspector there is a property named 'Columns'.
    Which shows Columns (TDBGridColumns) .. as shown in figure below



    How to assign the above property via code ?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    12
    Rep Power
    0
    Code:
    Dbgrid1.columns.add
    Will, for example, add a column.
    Code:
    Dbgrid1.columns.count
    ;
    Will return an integer of how many columns there are.
    If you type dbgrid1.columns. Delphi will drop down a list of all properties you can change.

    Comments on this post

    • ninadgac agrees

IMN logo majestic logo threadwatch logo seochat tools logo