I have been trying to get colouring to work in TeeGrid for the selected row and for alternate rows, as well as for hovering over a row but none of this seems to work as expected by setting values in the designer.
I have also noted that, to get the selected row to show its colour, I need to right-click somewhere in the TeeGrid first at runtime, then it works until I right-click again
class procedure TiOSTheme.ApplyTo(const AGroup: TRowGroup);
....
AGroup.Rows.Alternate.Visible:=True;
AGroup.Rows.RowLines.Visible:=False;
Re. " to get the selected row to show its colour, I need to right-click"
If there’s some setup tips you can pass over to help reproduce the issue please let us know, I can’t see that happening in the linked demo.
Marc
attached is a simple example. I found, in writing this, that there was something unusual in the way my TeeGrid was behaving but I could not see anything wrong with the definitions. So, I deleted it and added a new item which has resolved most of the issues I was asking about. There is still, however, one aspect that does not work as I would expect.
If one wants ScrollToView to work, then one has to first click in the TeeGrid to activate a Selected row. I would expect ScrollToView to work irrespective of whether a row is selected or not, assuming one has an Indicator defined.
One can see this behaviour with the test example. If one just starts stepping down the list of records using only the TNavigator, then one can scroll past the end of the visible list and keep going without the current record remaining visible in the TeeGrid. If one first clicks somewhere in the TeeGrid, this activates Selected and ScrolltoView behaves as expected.
I would also have expected Selected to refer to whichever record was the current record during initial FormShow i.e. to be the same as the row shown by the Indicator in this example.
An improvement has been applied for this issue, that will be included with the next TeeGrid update.
In the meantime, it could be applied to current TeeGrid code in this way:
replace the method, CheckScroll, in TeeGrid.pas, with:
procedure TCustomTeeGrid.CheckScroll(const ASelected:TGridSelection);
begin
if (ASelected.Column<>nil) and Root.CanScroll(True) then
CheckHorizScroll(ASelected.Column);
if Root.CanScroll(False) then
if ASelected.Row<>-1 then
CheckVertScroll(ASelected.Row);
end;
..then recompile TeeGrid with TeeGridRecompile.exe and load modified packages to the IDE.