Questions tagged [tstringgrid]

TStringGrid is VCL grid control designed to manage the handling of strings and associated objects in Delphi and related development tools. It is defined in the Grids.pas (or VCL.Grids.pas starting with Delphi XE2 version) unit.

The exact amount of features vary depending upon chosed devtool and its version.

Some documentation links include^

181 questions
6
votes
1 answer

How do I paint the background of TStringGrid

I do custom drawing of a Delphi TStringGrid using the OnDrawCell event. There is no problem with the area covered by cells, but how do I paint the background right of the rightmost column and below the last row ? (Edit) Painting is not really…
TheRoadrunner
  • 1,281
  • 14
  • 34
6
votes
3 answers

TStringGrid merge cell drawing

This link/pic shows what I am trying to achieve with a TStringGrid. This link/pic show what my code below is resulting in. unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,…
Jason Fowler
  • 83
  • 1
  • 1
  • 5
6
votes
2 answers

Selecting a row in TStringGrid from click on any cell within that row.

I have a TStringGrid object on a form which has 1 FixedCol and 1 FixedRow. I want to be able to select an entire row on the object when the user clicks on any cell within that row. This selection must also be visible to the user (I want the row to…
Seryth
  • 133
  • 1
  • 3
  • 10
6
votes
1 answer

What is the normal colo(u)r of a selected stringgrid row?

I am overriding OnDrawCell for a string grid. In certain circumstance, I want to use the normal TColor that is used for the selected row when the system does the drawing (no OnDrawCell). Which colo(u)r is that? clXXX ?
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
5
votes
1 answer

How simple to rotate text in stringgrid in delphi?

Is simple way to rotate text in stringgrid (90 and 45 degrees)? Or is there FREE component like TStringGrid with text rotation in cell?
Saboten
  • 61
  • 4
5
votes
4 answers

Detecting single vs multiple selections in Delphi TStringGrid

This is a follow up to my previous question Delphi TStringGrid multi select, determining selected rows regarding Delphi String Grids. It's a different question. I was looking more closely at the ONSelectCell Event TSelectCellEvent = procedure…
sse
  • 987
  • 1
  • 11
  • 30
5
votes
6 answers

Why is my code so slow?

Top-posted (sorry) answer, for those who don't have time to get into it but may have similar problems. Rule #1, as always, move as much as you can out of loops. 2, moving TField var := ADODataSet.FieldByname() out of the loop 3,…
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
5
votes
1 answer

Unintended tStringGrid.OnFixedCellClick firing behind tOpenDialog

I use Delphi Berlin on Windows 10. I need to use tOpenDialog on a tStringGrid based tForm. When I double click a file which overlaps a fixed column or row on an open dialog onFixedCellClick event fires automatically right after the disapperance of…
JO SeongGng
  • 567
  • 3
  • 18
5
votes
2 answers

How to convert TStringGrid from Delphi 7 to Delphi XE

Just for test how hard to convert my Delphi 7 program to Delphi XE 5 i wrote simple application on Delphi 7 - placed TStringGrid on Form, and added code on form create: procedure TFMain.FormCreate(Sender: TObject); begin With StringGrid1 do …
Nihila
  • 85
  • 4
5
votes
4 answers

Hiding focusRectangle for a StringGrid : Delphi

I'm trying to hide the border (focus rectangle) which Delphi draws around the currently selected cell in a StringGrid. I'm doing owner drawing to customize the appearance of the string grid. I've managed to get rid of everything but the…
Daisetsu
  • 4,846
  • 11
  • 50
  • 70
5
votes
0 answers

Example of Sorting a Firemonkey StringGrid

My basic attempt at sorting a Firemonkey Stringgrid, as couldn't find any other examples. I would welcome any optimisations or other suggestions on best achieving this. My code basically gets the column chosen to sort and with that sort order…
Paul Heinrich
  • 647
  • 1
  • 7
  • 15
4
votes
1 answer

How to avoid having a fixed column when adding columns dynamically to a TStringGrid at runtime?

I am using Lazarus 0.9.30.2. I have a standard TForm with a standard TStringGrid on it. The string grid has no columns or rows on it at design time. In the Object Inspector the following values are set. ColCount = 0 Columns = 0 FixedCols =…
user1174918
  • 525
  • 6
  • 22
4
votes
1 answer

ListView and coloring cellls

I have ListView (vsReport) and StringGrid and what I want is if I click on some element in ListView, particular cells in StringGrid have to change colors. How do I do it? Path is filled with 1 (move up) and 0(move right), it starts in left bottom…
qwertaz
  • 55
  • 5
4
votes
1 answer

Stringgrid with buttons

1st Question: How do you call the part in stringgrid that is not visible? You need to scroll to see it. For example: There are 20 rows in a stringgrid but you can see only 10 at a time. You need to scroll to see other 10. How are the "hidden" ones…
user805528
  • 189
  • 1
  • 5
  • 17
4
votes
4 answers

Setting background color of selected row on TStringGrid

I have a TStringGrid where the selected row (max 1, no multi-select) should always have a different background colo(u)r. I set the DefaultDrawing property to false, and provide a method for the OnDrawCell event, shown below - but it is not working.…
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
1
2
3
12 13