![]() |
Managing text Color in IWDBGrid - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: Managing text Color in IWDBGrid (/thread-2231.html) |
Managing text Color in IWDBGrid - Сергей Александрович - 01-09-2021 Below is the procedure for processing the onRendercell event of the dgMessage component (TIWDBGrid). Problem: ACell.BGColor := clWebLIGHTBLUE - works, ACell.Font.Color := clWebGreen; does not work. The background color changes, but the text color does not change. procedure TfmVmMain.dgMessageRenderCell(ACell: TIWGridCell; const ARow, AColumn: Integer); begin with dmVM do begin case dmVM.mtMessage.FieldByName('TYPE_REC').AsInteger of dmVM.mtMessage.Fieldbyname ('TYPE_REC').AsInteger of 0 : ACell.Font.Color := clWebBLACK; 1 : ACell.Font.Color := clWebNavy; // TextFont.Цвет: = clWebNavy; / / текст 2 : ACell.Font.Color := clWebGreen; // Header 1Font.Цвет := clWebGreen; / / Заголовок 1 3 : ACell.Font.Color := clWebMaroon; // Header 2Font.Color := clWebMaroon; / / Заголовок 2 end; if dgMessage.RowIsCurrent then begin mCurrentMID := mtMessage.FieldByName('MID').AsString; ACell.BGColor := clWebLIGHTBLUE;//clWebWHITE; end else begin ACell.BGColor := clWebGAINSBORO;// clMoneyGreen;// clWebWHITE; end; end; end; Tell me what is wrong? RE: Managing text Color in IWDBGrid - Сергей Александрович - 01-18-2021 I will formulate the question more compactly : procedure TfmVmMain.dgMessageRenderCell(ACell: TIWGridCell; const ARow, AColumn: Integer); begin if dgMessage.RowIsCurrent then begin ACell.Font.Color := clWebMaroon; // The color is not assigned! ACell.BGColor := clWebLIGHTBLUE; // The color is assigned, everything works as it should. end else begin ACell.Font.Color := clBlack; // The color is not assigned! ACell.BGColor := clWebGAINSBORO; // The color is assigned, everything works as it should. end; end; If you are using DbGrid a similar approach to the coloring of the lines is working. Am I doing something wrong or is it not working properly IWDBGrid ? |