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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:21:42+00:00 2026-05-25T01:21:42+00:00

I have a Delphi DBGrid that looks normal when it first loads. I have

  • 0

I have a Delphi DBGrid that looks normal when it first loads. I have setup an OnTitleClick event that sorts the DBGrid by the column when the title is clicked. As soon as you click on the title, the column title acts like a button being pressed and an ugly black line appears. (See Fig. 2 below)

As soon as the click event is done, the grid looks normal again.

How do you prevent this black line from appearing when you click the column title?

enter image description here

EDIT: QC Submitted to Embarcadero

While turning off the ability to resize columns does make the black line behavior disappear it does take away a very nice feature. I think this behavior needs to be fixed. I have submitted the following QC 98255 to Embarcadero. Please vote for this entry.

UPDATE: 2017-07-30

I found where this horizontal black line is being drawn.
Vcl.Grids > procedure TCustomGrid.DrawMove;

The Canvas.Pen.Width is set to 5. I changed it so the Canvas.Pen.Width := 1;
It looks much so much better. Now when I clicked on the “Contact_Last” title cell the black indicator line is just one pixel wide and much less intrusive.

enter image description here

procedure TCustomGrid.DrawMove;
var
  OldPen: TPen;
  Pos: Integer;
  R: TRect;
begin
  OldPen := TPen.Create;
  try
    with Canvas do
    begin
      OldPen.Assign(Pen);
      try
        Pen.Style := psDot;
        Pen.Mode := pmXor;
        //+----------------------------------------------------------------+
        // Modified 2017-07-30 by Michael J Riley (MJR)
        // Changed Pen.Width from 5 to 1
        // This makes the vertical black move-indicator line 1 pixel wide
        // Which is the same width as column resize vertical line
        //+----------------------------------------------------------------+
        //Pen.Width := 5;
        Pen.Width := 1;
        if FGridState = gsRowMoving then
        begin
          R := CellRect(0, FMovePos);
          if FMovePos > FMoveIndex then
            Pos := R.Bottom else
            Pos := R.Top;
          MoveTo(0, Pos);
          LineTo(ClientWidth, Pos);
        end
        else
        begin
          R := CellRect(FMovePos, 0);
          if FMovePos > FMoveIndex then
            if not UseRightToLeftAlignment then
              Pos := R.Right
            else
              Pos := R.Left
          else
            if not UseRightToLeftAlignment then
              Pos := R.Left
            else
              Pos := R.Right;
          MoveTo(Pos, 0);
          LineTo(Pos, ClientHeight);
        end;
      finally
        Canvas.Pen := OldPen;
      end;
    end;
  finally
    OldPen.Free;
  end;
end;
  • 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-25T01:21:42+00:00Added an answer on May 25, 2026 at 1:21 am

    The black line looks like a column order insert marker.

    Try looking for an option that disables column re-ordering.

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

Sidebar

Related Questions

I have a Delphi 2010 ADO program that has a DBGrid. Its dataset selects
I have a Delphi 2007 DBGrid that I'd like to allow the user to
I have a Delphi 7 application that has two views of a document (e.g.
I have a Delphi Web Server setup and running, publishing Web Services, and I
I have a delphi (Win32) web application that can run either as a CGI
I have a Delphi 5 executable that calls into a .NET assembly via the
I have a Delphi application similar to Taskbar Shuffle that includes a hook dll.
I have a DBGrid that shows a filtered view of a dBASE table. DBGrid
I have created a DBGrid in Delphi 6 and tied it to a DataSource
I have a Delphi exe that is built with packages. The exe processes successfully

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.