Link to home
Start Free TrialLog in
Avatar of Bem Bia
Bem BiaFlag for Russian Federation

asked on

DBGrid or StringGrid ?

Dentists programm.

MySQL tables:

manipulation
  • mid
  • tid (foreign key tooth.tid)

tooth
  • tid
  • tname
values (numbers of teeth, mucous membrane and paradontitis)

Question

When i want to chose tooth on a manipulation delphi form i need to use dentition form like this:
 User generated image
Numbers (18,17.......37,38) are names of teeth, 2 fields for mucous membrane and paradontitis.
I think primitive way - create many buttons named as 18,17.........37,38, mucous membrane, paradontitis,

how can i do this with dbgrid or stringgrid (with 2 horizontal rows), fields to mucous membrane and paradontitis will be buttons?
ASKER CERTIFIED SOLUTION
Avatar of Geert G
Geert G
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Is this the homework? Have you tried anything?
Avatar of Bem Bia

ASKER

Thanks for help,

 procedure TForm1.TeethClick(Sender: TObject);
var btn: TButton;
begin
  btn := TButton(Sender);
query.Sql.Clear;
  query.Sql.TExt:= 'INSERT INTO manipulation (mid, tid) Values (:mid, :tid) on duplicate key update tid= :t';
  query.Parameters.ParamByName('manidx').Value := manipulationid;
  query.Parameters.ParamByName('t').Value := 

Open in new window


how can i get Teeth(I)? i named
 query.Parameters.ParamByName('t').Value :=  btn.Tag 

Open in new window

and result is NULL
Avatar of Bem Bia

ASKER

No, its not my homework, when i was studying in university i was not intrested in learning information technologies :) I was stupid and now i have a chance to participate in competition.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bem Bia

ASKER

Thank  you