Friday, 11 June 2021

DevExpress TcxGrid Color Cell

Contoh coding warnakan cell row untuk grid DevExpress. 


procedure TfrmMain.GridMainDBTableView1CustomDrawCell(

  Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;

  AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);

begin

  if AViewInfo.GridRecord.Selected then

  begin

    ACanvas.Brush.Color:= clScrollBar;

    ACanvas.Font.Color:= clBlack;

  end;



    if (AViewInfo.GridRecord.Values[GridMainDBTableView1ES_AMT.Index] <= 0) then

        ACanvas.Font.Color:= clBlue;


    if (AViewInfo.GridRecord.Values[GridMainDBTableView1ES_AMT_LIMIT.Index] <

         AViewInfo.GridRecord.Values[GridMainDBTableView1ES_AMT_DISC.Index]) then

       ACanvas.Font.Color:= clRed;

  end;


 end;


No comments:

Post a Comment