I have a string grid that is filled as follows:
Jurnum LastName FirstName CheckedIn
132 Smith Jane No
167 Doe John No
231 Williams Stuart No
When the user doubleclicks on a row, I'd like to check a TStringList to see if the value of JurNum is in the list, if it's not there add the number and if it is there then remove the number. However, I can't figure out which row I'm on! I know that I need the first column, but how can I tell what row has been selected?
Thanks,
leslie
Jurnum LastName FirstName CheckedIn
132 Smith Jane No
167 Doe John No
231 Williams Stuart No
When the user doubleclicks on a row, I'd like to check a TStringList to see if the value of JurNum is in the list, if it's not there add the number and if it is there then remove the number. However, I can't figure out which row I'm on! I know that I need the first column, but how can I tell what row has been selected?
Code:
procedure TfrmRecordHours.sgRecordHoursDblClick(Sender: TObject);
begin
if CheckInList.IndexOf(Value of Column 0 and selected Row) = -1 then
begin
CheckInList.Add(Value of Column 0 and selected Row);
end
else
CheckInList.Delete(CheckInList.IndexOf(Value of Column 0 and selected Row));
FillRecordHOursGrid(qryRecordHours);
end;
Thanks,
leslie