GRID Row Height

Hi,

When adjusting the row heights, the first non-fixed column is not adjusted properly the first time. See image:



When I reapply the style it is adjusted.

code :

procedure TForm3.Grid1GetCellAppearance(Sender: TObject; ACol,
  ARow: Integer; Cell: TFmxObject; ACellState: TCellState);
begin
  grid1.RowHeights[arow]:= grid1.DefaultRowHeight+10;
end;
procedure TForm3.Button1Click(Sender: TObject);
begin
  grid1.ApplyStyle;
end;


greetings filip

PS : I am using v2.3.0.2 of the Firemonkey Pack.

OnGetCellAppearance is not the correct place to change the RowHeight. Please change the rowheight in the formcreate wrapping the code with grid.beginupdate and grid.endupdate.


Changing properties directly in events is not recommended.

Kind Regards, 
Pieter

ok thnx!

i couldn't do it on formcreate, beause it is Dependant on a dataset.

Now i update the rows on afteropen event of the dataset. And calcultate the rowheight oncalcfields event of the dataset.