CxGrid Şarta göre Satırı renklendirme
CxGrid Şarta göre Satırı renklendirme
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.
Re: CxGrid Şarta göre Satırı renklendirme
TcxGridDBTableView'in OnGetContentStyle event'ini kullanabilirsiniz.
- softdestek
- Üye
- Mesajlar: 155
- Kayıt: 17 Eyl 2010 03:53
Re: CxGrid Şarta göre Satırı renklendirme
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;