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

  • Home
  • SEARCH
  • 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 3672112
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:34:09+00:00 2026-05-19T02:34:09+00:00

I fear this might be a how long is a piece of string question,

  • 0

I fear this might be a “how long is a piece of string” question, but wondered if anyone has some hard figures or advice.

I have a TStringGrid which might have 3,600 rows, maybe more, we are not sure yet. Since the monitor obviously doesn’t have room for this, only 20 or 30 rows are shown on screen. Unfortunately, those are the first ones written and the user has to scroll down to see the rows as they are added.

It might be more user-friendly to reverse the order of the rows,m with newest first and oldest last. To do that, I would need to do something like this (code may not be exact)

  // slightly quicker if there are many rows & no flicker
  myStringGrid.Visible := False;      
  rowCount := myStringGrid.RowCount;
  for row := 1 to Pred(rowCount) do
      myStringGrid.Rows[row + 1] := myStringGrid.Rows[row];
  myStringGrid.RowCount := myStringGrid.RowCount + 1;
  // now add new row...
  myStringGrid.Cells[1, 0] := <somthing>;
  myStringGrid.Cells[1, 1] := <somthing else>;
  myStringGrid.Cells[1, 2] := <etc>;
  TestRunDataStringGrid.Visible := True;

I am concerned about performance. If no one has any experience, I will code a test & report back.

Just wondered if anyone had experience or an opinion of doing this…

  • 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-19T02:34:09+00:00Added an answer on May 19, 2026 at 2:34 am

    Try this one

    type
      TForm1 = class(TForm)
        StringGrid1: TStringGrid;
        ---
        ---
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
      type
      TStringGridHack = class(TStringGrid)
      protected
        procedure InsertRow(ARow: Longint);
      end;
    
    implementation
    
    {$R *.dfm}
    
    
    procedure TStringGridHack.InsertRow(ARow: Longint);
    var
      iRow: Integer;
    begin
      iRow := Row;
      while ARow < FixedRows do Inc(ARow);
      RowCount := RowCount + 1;
      MoveRow(RowCount - 1, ARow);
      Row := iRow;
    end;
    
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      TStringGridHack(StringGrid1).InsertRow(1);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I fear this is probably a bit of a dummy question, but it has
Quick question which I fear has a short and disappointing answer but alas I
I fear I may be displaying my ignorance with this question, but here goes...
I fear this just may not be possible, but I'm trying to create a
I have read several questions regarding this but I fear they may be out
I hope I'm not too vague with this question. For some reason I've developed
This might be a stupid question: If I add a gem in Gemfile (and
I want to develop a GAE application using python, but I fear that Google
This may sound very weird, but let's start with an example: <my:MagicWidget ui:field=someFieldName fieldName=someFieldName/>
I have a question about the safety of a cast from long to int.

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.