Solved

Delphi Programming question

Posted on 1997-09-05
3
181 Views
Last Modified: 2010-04-04
Hello!
Using TStringGrid component I want to move more than
one row in the grid.
How can I do that with D1?

Thanks,
   Tom

P.S.
Hello Ian!
Moving in my problem means I select more than 1 row in the StringGrid and like to move them lets say 1..n row to the top or
the bottom of the grid e.g. rows 10..15 are selected and I want to move them to row 2..7!!

Thanks for your ideas,
   Tom


0
Comment
Question by:ThomasG
3 Comments
 
LVL 2

Expert Comment

by:icampbe1
ID: 1343445
Unless you're a bit more clear, your probably gonna get some smart ass answers like:  Using the scroll bar lets you move them all.  
What do you mean by move?

Ian C.
0
 

Author Comment

by:ThomasG
ID: 1343446
Edited text of question
0
 

Accepted Solution

by:
gk082597 earned 20 total points
ID: 1343447
Hi,

In delphi 2 i should do it like this (on top of my head, not tested)

procedure TStringGrid1.MoveMultRows(FromRow,ToRow,NRow:Intger);
var
  i:Integer;
begin
  //Moving rows Down
  if ToRow>FromRow+Nrow then
    For i:=1 to Nrow do MoveRow(FromRow,ToRow);
  // Moving Rows Up
  if ToRow<FromRow then
    For i:=1 to Nrow do MoveRow(FromRow+NRow,ToRow);
//  if FromRow=FromRow then; do nothing
  if (ToRow>FromRow) and (ToRow<=FromRow+NRow) then
     MoveMultRows(FromRow+NRow+1,FromRow,ToRow-FRomRow);
// Recursive call, I did not run it my self so you might
// want to be carefull here.

end;

The Called MoveRow is a function of TCustomStringGrid (i think)
of which TString grid is derived.

Hope this help you on your way

GK
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi application Soap connection 5 130
Multiple image collision 13 87
Controlled Assessment GCSE - desperate help needed 4 110
Delphi...Split view - idea? 1 113
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

679 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