Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Copy dat froma stringgrid to a memo

Posted on 2004-04-14
2
Medium Priority
?
369 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 500 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

704 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