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
0
votes
5 answers

how to deal with large loops

i want to put a large string in a TStringGrid where every cell contains 4 chars from the string the StringGrid has 16 columns nc:=1; nr:=1; //nc = number of column . nr = number of raw while fs.Length>0 do // fs is a large string begin …
user4137704
0
votes
2 answers

Insert column into string grid, delphi

I have a string grid, from which i can delete columns. I defined a CustomStringGrid type that allows me to use DeleteColumn method. This is how it looks: TCustomStringGrid = class(TStringGrid) [...] With tCustomStringGrid(mygrid)…
user28470
  • 419
  • 5
  • 17
0
votes
0 answers

C++ Builder XE6 Firemonkey - How to align a column to right in TStringGrid

Could anyone tell me please how can I align one or two columns within a StringGrid as TStringColumn doesn't have text settings but TStringGrid has. When I align grom TStringGrid text settings unfortunately it align all columns.. Or does anyone can…
mesutuk
  • 402
  • 3
  • 17
0
votes
1 answer

Grid out of range error when importing CSV file

I am following this tutorial on importing CSV file to Delphi. I drafted the code provided below. The program compiles with no problems but when I attempt to execute function to read the file I get the grid out of range error message. unit…
Konrad
  • 17,740
  • 16
  • 106
  • 167
0
votes
1 answer

Easy Delphi XE6 FireMonkey Controls TListBox and TStringGrid

How does one get columns into a FireMonkey TListBox and then get the values out of the columns for the rows a TListBox. I am using this approach: vListRow := 'Col1Stuff' + '^I' + 'Col2Stuff'; This is NOT giving me Col1Stuff in the 1st column and…
Bruce Long
  • 713
  • 3
  • 9
  • 28
0
votes
1 answer

Odd drawing issue (black cells) in TStringGrid

I encountered something really really really odd with TStringGrid (Delphi XE). I have seen that sometimes when I click the first line in my grid, it turns black (or shows scrambled canvas 'stolen' from other controls on form). It happens ONLY in…
Gabriel
  • 20,797
  • 27
  • 159
  • 293
0
votes
2 answers

Delphi XE5 Firemonkey TStringGrid OnClick event

I have a very strange problem with Delphi Firemonkey TStringGrid on Android. It looks like that events on TStringGrid are triggered differently on windows and android platform. For example: in windows firemonkey application I have a string grid…
A.Z.
  • 69
  • 3
  • 10
0
votes
1 answer

How to call procedure with multiple parameters?

I have this code: edit5.Text := IntToStr(j); rw := j; myRect.Left := 0; myRect.Top := rw; myRect.Right := 5; myRect.Bottom := rw; stringGrid1.Selection := myRect; edit1.SetFocus; I must rewrite this code because I'm using it for many events (event…
Chino
  • 23
  • 1
  • 4
0
votes
3 answers

TStringGrid with SpeedButtons

I want to have a button with icon at the end of each row. Like here: I tried this procedure TMyFrame.sgrd1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var canvas: TCanvas; sgrd: TStringGrid; point:…
Alex P.
  • 3,697
  • 9
  • 45
  • 110
0
votes
2 answers

Can Delphi let user resize TStringGrid column without fixed rows?

I want to have a grid where all rows look the same In Delphi, how can i let the user resize TStringGrid columns without fixed rows? Normally you can only adjust the fixed rows, and you can't make the whole grid fixed. I am using XE2. TIA Mark
Mark Patterson
  • 417
  • 2
  • 6
  • 15
0
votes
1 answer

FixedColumn in StringGrid

It is possible to fix for example only third row in StringGrid?. StringGrid have property FixedColumn but you can start fixing columns only from the begining. tnx!
user2381189
  • 61
  • 1
  • 1
  • 5
0
votes
0 answers

EditBox inside StringGrid

I have problem with inserting Editbox in StringGrid. I have one StringGrid and one Editbox on my form. The editbox shows just fine in the selected col and row but i can insert just one number in the selected cell... can anyone explain me how to put…
user2381189
  • 61
  • 1
  • 1
  • 5
0
votes
2 answers

Searching the column of StringGrid1 to see what row it appears in StringGrid2 - Lazarus & Freepascal

Using Lazarus 1.1 and Freepascal 2.7.1, I have two StringGrids - StringGrid1 and StringGrid2. StringGrid1 contains three columns; the 3rd column of which contains unique values. StringGrid2 also has three columns, the 3rd of which also contains…
Gizmo_the_Great
  • 979
  • 13
  • 28
0
votes
2 answers

Calculating StringGrid height when adding a row

Given that I want my string grid to have equal height rows ... I know that it will start with exactly 5 rows and I make it so at design time. At run time I may want to add some extra rows (and I have code to not add below the bottom of the parent;…
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
0
votes
2 answers

How do I prevent the scroll wheel from selecting the last row of a TStringGrid?

I have a TStringGrid with several rows in which I implemented some kind of 'read-only' row. More exactly, I don't allow the user to click the penultimate row. If the user clicks the last row nothing happens; the focus won't be moved to the cells of…
Gabriel
  • 20,797
  • 27
  • 159
  • 293