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 7040223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:53:34+00:00 2026-05-28T01:53:34+00:00

Possible Duplicate: How to avoid TDbgrid scrolling when returning to a previous location I

  • 0

Possible Duplicate:
How to avoid TDbgrid scrolling when returning to a previous location

I am looking for a way to save and restore the vertical scrolling position of a Delphi TDBGrid after a refresh has occurred. Currently, the grid resets itself so that the selected record appears in the middle of the list of records.

At first, the properties LeftCol and TopRow appeared to be the solution, but only LeftCol works. The TopRow value is always 1 and never changes. It appears to be a position into the internal record buffer of the grid, which is set to the number of rows displaying in the grid. That is, it appears that FBuffers slides up and down, but TopRow remains 1 at all times.

A detailed example of what I’m seeing is:

  • The grid displays 11 records of a TClientDataSet, starting with record 5, displayng sequentially to record 15.
  • The selected record cursor is on record 15 (the last record in the view).
  • The dataset is refreshed through a TDataSetProvider linked to a TADODataSet. (An .Open or .Refresh call).
  • The dataset.Locate method is used to retain the actual selected record in the face of insertions/deletions.
  • The grid changes so that record 15 is in the center and it is displaying records 10 through 20.

Is there anything that can be saved/restored/performed so that the grid can be restored to its original viewing configuration showing records 5-15 with the cursor on the same selected record, wherever it appears?

The closest thing I can find in my many search attempts is an issue that was solved in Delphi 3.0 with TopRow, LeftCol, here: http://www.delphigroups.info/2/79/314206.html

Spelunking through DBGrids.pas isn’t netting me a method of locating the buffer pointers relative the underlying dataset records either.

  • 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-05-28T01:53:34+00:00Added an answer on May 28, 2026 at 1:53 am

    Seems that these questions should give you the answer:
    How to avoid TDbgrid scrolling when returning to a previous location
    Delphi – restore actual row in DBGrid
    (esp. this answer)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How can i avoid Location service in AlAssetLibrary? Can i retrieve files
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions
Possible Duplicate: Why avoid increment (“++”) and decrement (“--”) operators in JavaScript? I've heard
Possible Duplicate: How to avoid “!= null” statements in Java? Share your thoughts..
Possible Duplicate: Is there a clean way to prevent windows.h from creating a near
Possible Duplicate: System.Random keeps on returning the same value I'm refactoring and expanding a
Possible Duplicate: Avoid resending forms on php pages Index.html <form method=post action=demo.php> <input type=text
Possible Duplicate: Java floats and doubles, how to avoid that 0.0 + 0.1 +
Possible Duplicate: Inline styles vs styles in CSS i guess i'm looking for some
Possible Duplicate: What are the best practices for avoid xss attacks in a PHP

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.