How work condition function DrawDataCell in TsDBGRID

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #34767
    AndreSoft
    Participant

    I have the following code to paint the cells in a dbgrid with a condition function DrawDataCell

    if table.FieldByName if ('XXX'). Value = 'XX' then

    begin

    DBGrid1.Canvas.Font.Color: = clBlack;

    DBGrid1.Canvas.Brush.Color: = clRed;

    DBGrid1.Canvas.Font.Style: = [fsBold];

    end;

    DBGrid1.DefaultDrawDataCell (Rect, Field, State);

    In a standard Delphi DBGrid it works normally. In the component TsDBGrid (AlphaD:cool: cells are not painted. How can I do this?

    #46670
    Support
    Keymaster

    Hello

    I have made a test-application, but problem not exists here.

    Can you help me with reproducing please?

    #46725
    AndreSoft
    Participant

    Hello

    It works correctly when they are all fields in the DBGrid. If I edit some columns, they no longer work. My project has published several columns in which case they do not work

    http://www.youtube.com/watch?v=mCBFhL-qPoM

    #46730
    Support
    Keymaster

    You should use the OnDrawColumn event in this case.

    Standard grid have same behaviour.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.