Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7984539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:18:17+00:00 2026-06-04T11:18:17+00:00

I am making very simple test app, just to see how drag & drop

  • 0

I am making very simple test app, just to see how drag & drop works.

Basically I have two stringgrids, source & destination, and want to drag one cell from the source’s select row to the destination, creating a new row for it as I drop it.

In order to keep things as simple as possible, I am using drag mode = automatic, so as not to have to code manual drag mode handlers.

WIth just a few lines of code I can drag & drop, BUT only from the first row of the source. When I try to click on different row, to use that as the source, the OnClick event handler doesn’t even fire.

Short question … can I do what I want (both drag & drop and cange the source row) when using drag mode = automatic, or not?

The drop handler looks like this …

DestinationStringGrid.RowCount := DestinationStringGrid.RowCount + 1;
DestinationStringGrid.Cells[0, DestinationStringGrid.RowCount - 1] :=
    SourceStringGrid.Cells[0, SourceStringGrid.Row];

so, obviously, I want to be able to change SourceStringGrid.Row when I click on SourceStringGrid

Please let me know if teh question is not clear. Thanks in advance for your help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:18:18+00:00Added an answer on June 4, 2026 at 11:18 am

    You can use the OnStartDrag event to determine the mouse position where the drag started:

    procedure TForm1.StringGrid1StartDrag(Sender: TObject;
      var DragObject: TDragObject);
    var
      Pt: TPoint;
      C, R: Integer;
    begin
      Pt := StringGrid1.ScreenToClient(Mouse.CursorPos);
      StringGrid1.MouseToCell(Pt.X, Pt.Y, C, R);
      if (R > 0) and (R < StringGrid1.RowCount) then
        StringGrid1.Row := R;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was making this very simple lex program (just an introductory program). But on
Ok, I'm making a very basic vb.net winforms app, essentially you can drag files
I am making a very simple database (mysql) with essentially two types of data,
The problem: making a very simple style switcher with js (without inline event handling).
I'm making a very simple 2D RPG in Java. My goal is to do
We're making some calls to some very simple JSON web services in .NET CF
I'm making a very basic menu for my site and I have used the
Alright, here goes. I'm making a very basic app, and I want the user
I have a very big problem. I am making a CRM (Costumer Relationship Management)
This is making me very angry, I have worked on this for 2 days,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.