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 certain configurations, when the grid receives focus. Once you click another area in the grid everything looks ok until the focus is moved to another TStringGrid.
How to reproduce:
- put TWO string grids on a form
- set them as shown below (Update: I realized that goRowSelect and goEditing must be 'true')
- click the first cell in one grid -> nothing happens
- click the first cell in the second grid -> the first cell gets black (see screenshot)
The problem appears also in other circumstances (not necessary to have 2 grids on a form), but I managed to reproduce it only when I have 2 grids.
object grid1: TStringGrid <------- same for Grid2
Left = 2
Top = 8
Width = 422
Height = 381
BevelEdges = [beLeft, beTop]
DefaultColWidth = 80
DefaultRowHeight = 15
DoubleBuffered = True
FixedCols = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goColSizing, goEditing, goRowSelect, goFixedHotTrack]
ParentDoubleBuffered = False
TabOrder = 1
end
Any idea on how to fix this?