Topic: Send to another TableGrid with CheckBox

Hello everyone

In my project for a medical clinic I need to refer patients who have not attended.
I would like to know if it is possible to create a CheckBox in the TableGrid and, when selecting it, the record of patients who did not show up would be sent to another TableGrid.

Thanks

Re: Send to another TableGrid with CheckBox

Hello lejoso

Somethong like this ?

procedure Form1_TableGrid1_OnChange (Sender: string);
begin
    Form1.TableGrid1.Columns.InsertCheckBoxColumn(0);
end;

The checkbox will be inserted in column 1 (Column numbers start at 0)

JB

Re: Send to another TableGrid with CheckBox

Hello Jean
Thanks for your answer.
In fact what I would like to implement is to save a record on another table by clicking a checkbox inside the tablegrid.
I would like a script that made it possible.
Thanks a lot.

4 (edited by derek 2021-05-21 18:02:34)

Re: Send to another TableGrid with CheckBox

Oi Lejoso, Salut Jean,
It can be done, but I wonder if it would be more efficient to use the same table and have a status to show whether the patient has attended or has not shown up (please see the attached as an example).
Derek.

Post's attachments

Attachment icon lejoso non attending.zip 341.57 kb, 236 downloads since 2021-05-21 

Re: Send to another TableGrid with CheckBox

Hello Derek.
Thank you very much for your reply. Always helpful.
I thought about the solution you proposed, and it is quite valid.
But the records are inserted on an earlier date and on the day of the patient's care he has the records of all of them on the screen.
In the example you gave me, an edit of the record would be made with the choice of the status "attended" and "no show".
I would really like to make this step faster, so I thought about using the ChekBox.
I found the attached example on the forum that awakened this possibility.
I'm sorry for the english of the google translator.

Post's attachments

Attachment icon test.zip 4.5 kb, 195 downloads since 2021-05-25 

6 (edited by derek 2021-05-25 17:14:20)

Re: Send to another TableGrid with CheckBox

Oi Lejoso,
I would still use just one table and use a status (Attended / No Show).
To make it as quick as possibe, I would suggest making the tablegrids interactive;  the status can then be changed with a single click.
So, in the attached example, click on the > to change the status to 'No Show', click on the < to change the status to 'Attended'.
The filter by patient function works as it did before.

Post's attachments

Attachment icon lejoso non attending2.zip 343.13 kb, 214 downloads since 2021-05-25 

Re: Send to another TableGrid with CheckBox

Hi Derek
Great solution.
I will study it.
Thanks a lot.

8 (edited by derek 2021-05-25 22:06:38)

Re: Send to another TableGrid with CheckBox

Oi Again Lejoso,
If you have more than 2 statuses, using multiple tablegrids isn't really practical, in which case you could use a single tablegrid and make the status column interactive. 
So, in the attached example, if you double-click on the 'Appointment Date' column or on the 'Patient Name' column, you can edit the record. 
But if you double-click on the 'Status' column, it cycles through the different statuses that are available ( 'Appointment Booked', 'Appointment Kept' and 'Appointment Missed'.   Doing it this way, you can always add new statuses and there is no need to change the code.
The STATUS column heading is marked with an '*' to tell the user that the column is interactive.
The 'patient' and 'status' filters work as before.
I guess the best way is whichever is closest to what you're trying to achieve.
Regards,
Derek.

Post's attachments

Attachment icon lejoso non attending3.zip 342.54 kb, 279 downloads since 2021-05-26 

Re: Send to another TableGrid with CheckBox

Hello Derek
It exceeded my expectations.
Thank you very much.
You are an ace.