Solved

Copy dat froma stringgrid to a memo

Posted on 2004-04-14
2
353 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
2 Comments
 
LVL 22

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi: how to send PJL commands to printer 3 97
delphi parse string to params 3 121
Firemonkey DbLookupComboBox equivalent ? 2 47
Tidtcpserver listening on multiports? 1 26
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

813 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now