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

    Join Date
    Mar 2007
    Posts
    169
    Rep Power
    37

    Delphi and dbgrid


    I have a dbgrid. If i click on a line a populate a textbox with somedata out of the grid. Works nice i use the oncellclick event. now on the far left you have an arrow wich you can use to select a line in the grid. only problem is it doe snot reconize the onclick event if you click there so there for my textbox dont get any info on it.

    I dont know really what to search for on the net or how to explain it beter.

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

    Join Date
    Jun 2008
    Posts
    356
    Rep Power
    7
    I'm assuming you are talking about the arrow that is within the dbgrid. That "column" is not a cell based on a field in your database so that is why the oncellclick is not firing.

    Perhaps you can use the "AfterScroll" event of your table/query component, and populate the textbox with a default field value from the new record. One drawback is if you click the arrow on the currently selected row, the event won't fire.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2007
    Posts
    169
    Rep Power
    37

    Re


    Thanks.I used the mouse over.Some reason that work!!

    Thanks for your help in anycase.Much appreciate it!!
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    Somewhat off topic observation you should feel free to ignore

    My own personal experience over many years is that using dbGrids with SQL databases
    for anything other than read only displays or simple editing situations (like maintaining lookup tables),
    eventually comes back to bite me.
    The extra effort involved in using grids that are not db aware and managing the database
    interaction myself has paid off handsomely.

    Clive

IMN logo majestic logo threadwatch logo seochat tools logo