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

x
?
Solved

Delphi Programming question

Posted on 1997-09-05
3
Medium Priority
?
195 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
[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
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 40 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

670 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