Solved

Copy dat froma stringgrid to a memo

Posted on 2004-04-14
2
365 Views
Last Modified: 2010-04-05
Hi,

I have 2 columns in a stringgrid, I would like to copy the first columns data to memo1, and the second to memo2, how can I do this?

Thank
Asw
0
Comment
Question by:Asw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
Ferruccio Accalai earned 125 total points
ID: 10824089
memo1.Lines.Assign(stringgrid1.Cols[1]);
memo2.Lines.Assign(stringgrid1.Cols[2]);

this will pass every cell to memo, also the topmost one....
if you don't need that simply delete it after the assigning
memo1.lines.delete(0);
memo2.Lines.delete(0);
0
 
LVL 17

Expert Comment

by:mokule
ID: 10824130
procedure TForm1.Button1Click(Sender: TObject);
var
  i: integer;
begin
  Memo1.Clear;
  Memo2.Clear;
  for i := StringGrid1.FixedRows to stringgrid1.RowCount-1 do
    begin
    Memo1.Lines.Add(StringGrid1.Cells[StringGrid1.FixedCols,i]);
    Memo2.Lines.Add(StringGrid1.Cells[StringGrid1.FixedCols+1,i]);
    end
end;
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month3 days, 11 hours left to enroll

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question