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
17
votes
1 answer

How To Scroll a TStringGrid dynamically?

I am working in the Borland C++Builder IDE, using VCL controls. I am trying to get a TStringGrid component to scroll down to a row and highlight that row, based on user input in a different form. I have the highlight portion done, but I can't figure…
Ben313
  • 1,662
  • 3
  • 20
  • 32
17
votes
3 answers

TStringGrid - is there a simple way to get the "current/selected" row?

I can go the long way round, loop over each row, get a TRect from CellRect(col, row), then query its State for gdSelected ... But isn't there a quicker way to get the row number of the currently selected row, if any?
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
16
votes
3 answers

How do I delete a TStringGrid row?

I have a TStringGrid, and I want to delete the selected row. Basic things I've tried only delete the last row. How do I delete an arbitrary row?
CrazyGirl
  • 211
  • 1
  • 2
  • 9
15
votes
4 answers

FillRect doesn't paint the complete TStringGrid cell in Delphi XE2

FillRect doesn't paint the complete TStringGrid cell in Delphi XE2. There is a gap of 3 pixels on the left side in the default color (with BiDiMode set to bdLeftToRight). This problem doesn't exist in Delphi 6 which I used before. procedure…
Finike
  • 151
  • 1
  • 4
14
votes
3 answers

delphi : how can I change color of a cell in string grid

I want to change background color ( not font ) of a cell in string grid in delphi . Just one cell not a row or a column. Can I? RRUZ : your procedure is correct and works but in my procedure doesn't work. My procedure: x is a global array of…
Arash
  • 9,705
  • 4
  • 18
  • 12
13
votes
6 answers

Recommendations for the most useful Delphi TStringGrid (Grid) replacement

One of the weaker areas of Delphi are the grids (eg TStringGrid) where, although it does a good basic job, it becomes harder when you need to print it or customise its appearance. I've used it for about 15 years thus its pretty embedded within my…
Brian Frost
  • 13,334
  • 11
  • 80
  • 154
13
votes
8 answers

How can I detect when a user is finished editing a TStringGrid cell?

I would like to return the contents of a cell in a string grid when the user finishes entering the data. The user is finished when pressing the enter key on the keyboard, or single- or double-clicking another cell. In Lazarus there is a method of…
Renier Engelbrecht
  • 131
  • 1
  • 1
  • 3
11
votes
3 answers

Put a TCheckBox inside a TStringGrid in Delphi

I want to put a TCheckBox inside a TStringGrid in Delphi in every cell of certain column. I'm using Delphi XE.
alexzm1
  • 563
  • 2
  • 7
  • 14
10
votes
4 answers

Delphi TStringGrid Flicker

I am adding multiple rows to a string grid from a CSV file @ runtime, However the StringGrid seems to flicker lots when it is being upadated, I presumed there would be a beginupadate / Endupdate command to stop this. However I cannot find it. Is…
colin
  • 2,983
  • 6
  • 41
  • 49
8
votes
2 answers

Delphi - Drawing to the canvas of a selected cell in a string grid - possible?

I want to draw on the canvas of a cell in a string grid. This is going to be on top of an image preloaded into the string grid. What I've got Currently instead of drawing on top of the image, I am loading a second transparent image and then painting…
Josh Slade
  • 115
  • 1
  • 2
  • 5
7
votes
2 answers

How can you get hints for cells in a TStringGrid appearing more smoothly?

I am running Lazarus 0.9.30. I have a standard TStringGrid on a form and want to show a different hint as I move my mouse pointer over a column title. I am using this code to do this and it sort of works but you often have to click on the cell to…
user1174918
  • 525
  • 6
  • 22
7
votes
1 answer

How can you change the text orientation in cells in the fixed rows in a Delphi TStringGrid

I have a standard TStringGrid on a form. I have one Fixed Row in the grid that contains a number of columns, which are all TGridColumns objects. I have set the column titles using the object inspector and the default orientation is horizontal. Is…
user1174918
  • 525
  • 6
  • 22
7
votes
1 answer

Change color of font of TStringGrid's cell

I need to change the text color in a cell of TStringGrid in Delphi. Just a cell. How can I do that?
user980115
  • 83
  • 1
  • 1
  • 5
6
votes
1 answer

delphi xe2 stringgrid with comments

Can anyone recommend a good stringgrid like component for Delphi that handles comments on each cell similar to Microsoft Excel? I am searching the web but haven't found much yet and would appreciate input if someone here has used something…
Joe
  • 999
  • 1
  • 8
  • 20
6
votes
2 answers

How to show more than 200 rows in TStringGrid using LiveBindings?

I have a TDataSource that is backed by a TClientDataset bound to a TStringGrid. I did this by right-clicking on the grid, selecting "Link to DB Datasource...", and selecting the DataSource. This setup the LiveBindings for me. When I run the…
Marcus Adams
  • 53,009
  • 9
  • 91
  • 143
1
2 3
12 13