February 9th, 2005, 03:32 PM
Clicking fixed rows (string grid)
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
February 10th, 2005, 02:54 AM
Why don't you use double click event on the "non-fixed" row(s) ?
February 10th, 2005, 11:56 PM
Take a look at OnMouseDown event and MouseToCell method.
February 15th, 2005, 11:29 AM
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.
August 16th, 2012, 11:45 PM
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.