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

    Join Date
    Jul 2003
    Posts
    9
    Rep Power
    0

    Clicking fixed rows (string grid)


    Hi guys

    I'm very new to Delphi (only been using since October at college) and I've come to a problem that neither Google nor my teacher have been able to produce an answer.

    I have a string grid which displays the attendance for the employees at a branch with 1 fixed column (employee names) and 1 fixed row (dates 1-31). What I want to happen is when I click on one of the dates in the fixed row to display another form that I have with the attendance so it can be editted.

    The problem I have encountered is that none of the events I have used so far have picked up when I click on the fixed row. Obviously I could change the fixed row to a normal row but that would spoil the look.

    Any suggestions would be very much appreciated.

    Thank you for your time
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Location
    Romania
    Posts
    173
    Rep Power
    11
    Why don't you use double click event on the "non-fixed" row(s) ?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    93
    Rep Power
    11
    Take a look at OnMouseDown event and MouseToCell method.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    9
    Rep Power
    0
    Thanks for the replies guys

    Sorry it's taken me so long to get back to you, been a very busy few days.

    I've finally given up on the idea of fixed rows if I need to be able to click on them. However, my form doesn't look right without them. I was wondering there was a way in which only one row can be coloured (a column would be nice as well although I'm sure it would be reasonably easy to adapt any code that was put forth).

    Thank you for your time and I hope I can solve this problem a little easier.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0
    In Delphi XE there is an "On Fixed Cell Click" event but the catch is that you need to enable the grid option "goFixedRowClick" or "goFixedColClick" for it to fire.

    This event, once working, is a bit nicer than using MouseDown as it will give you the row and col without needing to use the MouseToCell method.

    Sorry to drag up a thread from 2005 but as it was the first link for a google search on "delphi stringgrid click fixed cell" and it may save the next person some time.

IMN logo majestic logo threadwatch logo seochat tools logo