Topic: OnDrawColumnCell

Hello

It seems that with TableGrid, method OnDrawColumnCell is not enabled.
(I tried to get something like TableGrid1.OnDrawColumnCell.Enabled := True
and I get an error message).

Should it be possible to allow this in next version of MVD ?
We could put color on alterned rows, get an alignment for title et son on ...

Thanks

Jean B.

Re: OnDrawColumnCell

Hello,


Thanks for suggestion.


I can include in the future, these events:
OnCellFormating(Sender: TObject; ACol, ARow: Integer; var TextColor: TColor; var FontStyle: TFontStyles; CellState: TCellState);
OnCellColoring(Sender: TObject; ACol, ARow: Integer; var CellColor, GridColor: TColor; CellState: TCellState);



In beta version 1.44
https://www.dropbox.com/s/2phoggh5kfu88 … 4.zip?dl=0


you can use event OnChange for coloring cells, Example:

procedure Form1_TableGrid1_OnChange (Sender: string);
var
    i,c: integer;
begin
    c := Form1.TableGrid1.RowCount - 1;
    for i := 0 to c do
    begin
         if Form1.TableGrid1.Cells[3,i] = 'Yes' then Form1.TableGrid1.Cell[3,i].Color := clRed;
         if Form1.TableGrid1.Cells[3,i] = 'No' then Form1.TableGrid1.Cell[3,i].Color := clGreen;
    end;
end;

Here you can download example project:
http://myvisualdatabase.com/forum/misc. … download=1

Dmitry.

Re: OnDrawColumnCell

Hello

Thanks for your example. It works fine.

But one question : why not using directly  OnDrawCell as with Delphi ou RAD XE3 ?

Thanks again

Jean B.

Re: OnDrawColumnCell

jean.brezhonek
It will be difficult for most users.

Dmitry.