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

    Join Date
    Oct 2012
    Location
    São Paulo - Brazil
    Posts
    35
    Rep Power
    2

    Create a line of edit boxes in the top of a DBGRID


    I have an application that have a DBGRID and I would like implement filters on every column via a text box(or similar) that I will put in the top of each column of the grid.

    BTW, the main problem seems to be how change the text boxes width when the user alter the DBGRID columns width. Although it will be very useful some suggestion about how to implement the text boxes themselves.

    The idea is apply a filter in the column based on the string typed in the top text boxes.

    (Remember that this is a legacy application)

    Greetings from São Paulo - Brazil

    Ricardo
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    156
    Rep Power
    3
    I never done this, but a peek to TDBGrid source suggested that you need to derive from it to hook into column width changes event. So you can not do this in form level.

    Create a descendant of TDBGrid, overrride its ColWidthsChanged dynamic method and expose the event as a new published or public event. Then use this new event to adjust your text boxes widths (this time in form level).

IMN logo majestic logo threadwatch logo seochat tools logo