CxGrid Şarta göre Satırı renklendirme

Delphi .net ve .net ile ilgili konuları buraya yazabilirsiniz.
Cevapla
Bulutiib
Üye
Mesajlar: 41
Kayıt: 13 Ara 2013 12:45

CxGrid Şarta göre Satırı renklendirme

Mesaj gönderen Bulutiib »

Merhaba arkadaşlar size bi sorum olacak. cxgridi şarta göre renklendirmek istiyorum mesela. Tahsilat ödeme satis alis diye işlem türlerim var. ben cariye satış yaptığımda veya alis yaptığımda o satırları ayrı ayrı renklendirmek istiyorum nasıl yapabilirim acaba.Şimdiden teşekkür ederim.
thelvaci
Kıdemli Üye
Mesajlar: 770
Kayıt: 11 Tem 2010 07:17
Konum: Istanbul
İletişim:

Re: CxGrid Şarta göre Satırı renklendirme

Mesaj gönderen thelvaci »

TcxGridDBTableView'in OnGetContentStyle event'ini kullanabilirsiniz.
Kullanıcı avatarı
softdestek
Üye
Mesajlar: 155
Kayıt: 17 Eyl 2010 03:53

Re: CxGrid Şarta göre Satırı renklendirme

Mesaj gönderen softdestek »

http://www.codedisqus.com/0NiePPUPXU/ho ... d-row.html

Kod: Tümünü seç

procedure TfrmMessaging.cxGrid1DBTableView1CustomDrawCell(
  Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
  AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
begin
  if Sender.DataController.GetValue(AViewInfo.GridRecord.RecordIndex, 4) = '1' then
    ACanvas.Brush.Color := clRed;
end;

Kod: Tümünü seç

procedure TfrmNewOffer.GrdOffDetailViewRemarkCustomDrawCell(
  Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
  AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
  backgroundColorCode: Variant;
  textColorCode: Variant;
begin
  inherited;
  if assigned(AViewInfo) and assigned(AViewInfo.GridRecord) then
  begin
    backgroundColorCode := AViewInfo.GridRecord.Values[GrdOffDetailViewBackColorCode.Index];
    textColorCode := AViewInfo.GridRecord.Values[GrdOffDetailViewTextColorCode.Index];

   if not VarIsNull(backgroundColorCode) then
   begin
     ACanvas.Brush.Color := backgroundColorCode;
   end;

   if not VarIsNull(textColorCode) then
   begin
     ACanvas.Font.Color := textColorCode;
   end;
 end;
Cevapla