roosiedb
asked on
Click on DBGrid to use that record...?
HELP HELP HELP
How can I use the specific record which has been selected by a click (on a row of the DBGrid) to use this record to add in a TMemo.
For example: I have a DBGrid on the form, and when I click on a specific row, the value of the field "NAME" must be added in the memobox which is located on that same form.
HELP HELP HELP
Jan van Barchum
How can I use the specific record which has been selected by a click (on a row of the DBGrid) to use this record to add in a TMemo.
For example: I have a DBGrid on the form, and when I click on a specific row, the value of the field "NAME" must be added in the memobox which is located on that same form.
HELP HELP HELP
Jan van Barchum
.. or this, if you want the value of the cell, the user clicked at:
procedure TForm1.DBGrid1CellClick(Co lumn: TColumn);
begin
Memo1.Lines.Add(Column.Fie ld.AsStrin g);
end;
procedure TForm1.DBGrid1CellClick(Co
begin
Memo1.Lines.Add(Column.Fie
end;
What really happens when you click on a record in a DBGrid is your changing the current-record pointer to the selected record. Keeping that in mind, all you need to do is what kretzschmar and/or asem stated (which is the same) !
ASKER
It worked perfect !!
How can I give you (kretzschmar) the points?
Thank you for your help.
Jan van Barchum.
How can I give you (kretzschmar) the points?
Thank you for your help.
Jan van Barchum.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This question was awarded, but never cleared due to the JSP-500 errors of that time. It was "stuck" against userID -1 versus the intended expert whom you awarded. This corrects the problem and the expert will now receive these points; points verified.
Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them. If you are an EE Pro user, you can also choose Power Search to find all your open questions.
This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
https://www.experts-exchange.com/jsp/zonesAll.jsp
Thank you,
Moondancer
Moderator @ Experts Exchange
Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them. If you are an EE Pro user, you can also choose Power Search to find all your open questions.
This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
https://www.experts-exchange.com/jsp/zonesAll.jsp
Thank you,
Moondancer
Moderator @ Experts Exchange
try this in the onclick event of your dbgrid
memo1.lines.add(dbgrid1.da
meikl ;-)