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
3
votes
3 answers

Delphi TStringGrid multi select, determining selected rows

Is there anyway to determine which rows are currently selected in a multi-select TStringGrid, or a TCustomGrid for that matter. A property would be ideal. I know that there is the gdSelected property that gets set in the DrawCell event,…
sse
  • 987
  • 1
  • 11
  • 30
3
votes
2 answers

Using Data from TStringGrid in Record

I've created a record type TTableData in Pascal for storing information from a TStringGrid for later use: TTableData = record header: String[25]; //the header of the column (row 0) value : String[25]; //the string value of the data number:…
3
votes
3 answers

Delphi StringGrid with picture in background

Hi does anyone know if it is possible to display a picture as a background to a string grid, Or is anyone aware of any free Grid component that can do this. Thanks colin
colin
  • 2,983
  • 6
  • 41
  • 49
3
votes
1 answer

How to unselect cell in a FireMonkey TStringgrid

Does anyone know how to unselect cell in a FireMonkey TStringgrid (in other words, i need to know which cell is selected and how to unselect)...? We are using Delphi Berlin 10.1 Thanks in advance.
Jande
  • 1,695
  • 2
  • 20
  • 32
3
votes
5 answers

Delphi: StringGrid, position and Context Menu

I'm having a problem with using a TStringGrid and Popup menu I want to know the Row / Column of the cell that was last active when select an item from my Popup menu. However when I click on the popup menu, the StringGrid.Row is returned as -1. I've…
Dan Kelly
  • 2,634
  • 5
  • 41
  • 61
3
votes
2 answers

How to format StringGrid cell borders

I am trying to format a Delphi TStringgrid depending on cell contents and position. Whilst I can change the cell colour and shape depending on the cell contents I am having more problems with the cell borders. I want to be able to have a thicker…
Dan Kelly
  • 2,634
  • 5
  • 41
  • 61
3
votes
1 answer

TStringGrid: Why OnClick after OnKeyDown

Why does a Delphi StringGrid sometimes calls the OnClick event after an OnKeyDown? Debugging screenshot: My OnKeyDown event handler: var Top: Integer; Bottom: Integer; CurrentRow: Integer; begin Top := Grid.TopRow; Bottom := Grid.TopRow +…
user729103
  • 631
  • 2
  • 10
  • 24
3
votes
1 answer

How to display row number in TStringGrid?

How do I create a column in a TStringGrid in FireMonkey that displays the row number? If it's by using a LiveBinding, I can't figure out how.
Marcus Adams
  • 53,009
  • 9
  • 91
  • 143
3
votes
1 answer

Mouse over stringgrid when dragging?

Parts of my stringgrid are eligible drop targets, and some are not (first row is column headings, first column is a sort of index and subsequent columns may be dropped to). I have that coded and working. Now I am thinking that it might be nice to…
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
2
votes
1 answer

Why Do The Cell Properties In A TStringGrid Column Title Cells Change When A Grid Is Loaded?

I am running Lazarus v0.9.30 (32 bit compiler). This question is an extension of a previous question of mine. The previous question revolved around how to change the orientation of text in the TGridColumns objects that I loaded at runtime into a…
user1174918
  • 525
  • 6
  • 22
2
votes
1 answer

How do you associate an object to a TGridColumns object

I am running Lazarus 0.9.30. I have a standard TStringGrid on a form and have a function that dynamically adds TGridColumns objects to it at run time. I have a collection of objects that contain all the attributes of each column (that I read out of…
user1174918
  • 525
  • 6
  • 22
2
votes
2 answers

String Grid using Styles in Delphi XE2 - Scroll bar doesn't update

I'm making a simple application in Delphi XE2 which uses specifically the "Carbon" style. There's a large String Grid which has thousands of rows. I have a process which loops through the records of this grid, does some work, and makes some changes…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
2
votes
2 answers

FMX Custom Header for TStringGrid

I am using this code to set the column Headers for my TStringGrid (FMX - 10.4.1) procedure TForm1.StringGrid1ApplyStyleLookup(Sender: TObject); var Header: THeader; HeaderItem: THeaderItem; I: Integer; begin Header:= THeader((Sender as…
Bob Baudewyns
  • 163
  • 1
  • 14
2
votes
2 answers

Delphi, String Grid is not selectable, How to make it selectable to select Row or Col?

I am having a StringGrid in Delphi 5 of fixed rows and Fixed Cols. But at run mode I am not able to select any row or any cell. How and what is the property that allow me to make String Row or cell selectable.
PawanS
  • 7,033
  • 14
  • 43
  • 71
2
votes
1 answer

OnDrawCell Center Text StringGrid - Delphi

I'm trying to get the text in my StringGrid to center. After some research I came up with this function posted by someone else here that when used on DefaultDraw:False should work. procedure TForm1.StringGrid2DrawCell(Sender: TObject; ACol, ARow:…
Flatlyn
  • 2,040
  • 6
  • 40
  • 69