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
1
vote
1 answer

How do I properly display a combined image in a Delphi `tstringgrid` component

I have a game program that requires the user to select from 50+ images to place on a 9x9 game board grid with a timage in each position. For the user to place the images, I am providing a tstringgrid which displays various images from a timagelist.…
Ashlar
  • 636
  • 1
  • 10
  • 25
1
vote
1 answer

How to post data to database immediately after editing is done in a firemonkey TStringGrid

In Rad Studio 10.3, I connect a StringGrid to a database by using LiveBindins Wizard and selecting FireDAC. Everything is fine except below issue: When user edits a cell and presses Enter the value is edited correctly but the new value does not post…
Moj.H
  • 75
  • 12
1
vote
2 answers

How to set text alignment for a specific column in firemonkey TGrid/TStringGrid?

In firemonkey (RAD Studio 10.3), I am working with a TStringGrid connected to a database and I want to change the text alignment of a specific column. How can I do that? Changing HorzAlign in TextSettings property, changes the alignment of all…
Moj.H
  • 75
  • 12
1
vote
2 answers

TStringGrid show (bcd) in delphi live binding

I connect TFDQuery with TStringGrid in live binding in delphi firemonkey apps. I tried to use filter in TFDQuery based on Editbox for searching purpose, and it's work just fine. but, whenever I clear the Editbox, one of my row in TStringGrid would…
punk73
  • 378
  • 2
  • 12
1
vote
1 answer

Delphi : move between string grid with tab

I have a number of TStringGrid components in a Form. I want to move between the StringGrids using tab. The problem is that when the goTabs is activated, then it nicely moves between the cells of the StringGrid , but as soon as the bottom right cell…
Spymag
  • 105
  • 1
  • 9
1
vote
2 answers

How to move cursor position in Delphi StringGrid cell?

When you have a TStringGrid with the goEditing option set and a cell has several lines of text in it, when you go to edit that cell by clicking on it, the cursor will be at the very end of that text. How can you move the cursor to another position?…
fullerm
  • 406
  • 1
  • 8
  • 23
1
vote
1 answer

TStringGrid: Is it possible to find out the 'State' of a cell?

I want to implement a FillCell procedure for TStringGrid. I want to fill a certain cell with a color but only when the cell (row) is not selected. procedure TMyStrGrid.FillCell(Rect: TRect; aColor: TColor); begin //if NOT (gdSelected in State) then…
Gabriel
  • 20,797
  • 27
  • 159
  • 293
1
vote
1 answer

lazarus grids key-value pair

In the lazarus (and also delphi probably) documentation about grids, we can find the next description for the InsertRow function: Function InsertRow Inserts a row in the grid and sets the Key-Value pair. Returns the index of the newly…
hdrz
  • 461
  • 6
  • 12
1
vote
2 answers

Deleting a selected row via mouse click in TStringGrid using delphi

I'm not sure how i would capture the row selected by a mouse click and then press a button to delete that selected row in a stringGrid in delphi. procedure DeleteRow(Grid: TStringGrid; ARow: Integer); var i: Integer; begin for i := ARow to…
ProtectorOfUbi
  • 317
  • 5
  • 13
1
vote
1 answer

Delphi - OnKeyPress occurs before TStringGrid updates cell with new character

Coding in Delphi, attaching an OnKeyPress event handler to a TStringGrid: The OnKeyPress event fires before the grid cell that the user is typing into has actually updated its value with the key that has been pressed. This is obviously a problem,…
JMTyler
  • 1,604
  • 2
  • 21
  • 24
1
vote
1 answer

Stringgrid content in other application

Heading : How can I read a StringGrid content in another application's window? I could get the StringGrid's handle
Emre Duman
  • 13
  • 3
1
vote
0 answers

Delphi TStringGrid Background color missing on left side

I use the following custom OnDraw to colorize background of a cell depending on column number: procedure TForm_ControlPanel.aoc_gridDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var grid: TStringGrid; S:…
Andreas Hinderberger
  • 1,505
  • 23
  • 41
1
vote
2 answers

Is there a stringgrid in objective-c cocoa framework as there is in Delphi

Is there a StringGrid in the Cocoa Framework or has anybody implemented one that would be like the one in Delphi?
earlcenac
  • 11
  • 4
1
vote
0 answers

How to change the text color of TStringGrid in Firemonkey Delphi XE5

I want to be able to change text color for certain rows. For example if cell value below 0 i want in red, other than that green.
mghazal
  • 48
  • 7
1
vote
0 answers

Problem with horizontal scrolling on TStringGrid

I have problem with wide grids of type TStringGrid. If user scrolls grid to the right and selects row then grid automatically scrolls left so first column can be seen, but not the column user is interested in. How to prevent such scrolling? I use…
Michał Niklas
  • 53,067
  • 18
  • 70
  • 114