cxgrid de satir nasil renklendirilir

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
mero
Üye
Mesajlar: 109
Kayıt: 04 Mar 2005 04:54

cxgrid de satir nasil renklendirilir

Mesaj gönderen mero »

quantum grid 5 kullaniyorum. sarta bagli olarak istedigim herhangi bir satira renk vermek istiyom ama nasil?
oguzozturk74
Kıdemli Üye
Mesajlar: 574
Kayıt: 01 Şub 2004 12:29
Konum: Erdemli - MERSİN

Mesaj gönderen oguzozturk74 »

Çok kapsamlı bir demosu var onu incelemenizi tavsiye ederim .

ilk etapta

C:\Program Files\Developer Express Inc\ExpressQuantumGrid 5\Delphi 7\Demos\CustomDrawTableViewDemo

e bakabilirsin mesela .
Kullanıcı avatarı
vkamadan
Kıdemli Üye
Mesajlar: 1935
Kayıt: 17 Mar 2004 03:52
Konum: Adapazarı
İletişim:

Mesaj gönderen vkamadan »

merhaba,
gridin OnCustomDrawCell olay metoduna yazabilirsin AColor değişkenin şarta bağlı renk verebilirsin.

Kod: Tümünü seç

if query1sayi.asinteger=1 then AColor:=clRed;
gibi kolay gelsin
Volkan KAMADAN
www.polisoft.com.tr
hasan
Üye
Mesajlar: 129
Kayıt: 16 Oca 2004 10:01
Konum: Bursa
İletişim:

cxgrid de satir nasil renklendirilir

Mesaj gönderen hasan »

Kod: Tümünü seç

procedure TTaksit_Formu.Taksit_Takip_GridDBTableView1StylesGetContentStyle(
  Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
  AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);

 Var
    KolonKALAN_TUTAR,KolonVADE_TARIHI: TcxCustomGridTableItem;
begin
If Data.AUTO_TABLESATIR_RENGI_UYARISI.asInteger=1 Then Begin
  KolonVADE_TARIHI:= (Sender as TcxGridDBTableView).GetColumnByFieldName('VADE_TARIHI');
   KolonKALAN_TUTAR:= (Sender as TcxGridDBTableView).GetColumnByFieldName('KALAN_TUTAR');
      if (ARecord.Values[KolonVADE_TARIHI.Index]) < (Now - Data.AUTO_TABLEUYARI_SAYISI.AsInteger ) then
        if (ARecord.Values[KolonKALAN_TUTAR.Index]) > 0 then
       AStyle := cxStyleNullKalan_Tutar;
    End;
End;
hasan
Üye
Mesajlar: 129
Kayıt: 16 Oca 2004 10:01
Konum: Bursa
İletişim:

CxGrid 5 satır renklendirme

Mesaj gönderen hasan »

Kod: Tümünü seç

procedure TTaksit_Formu.Taksit_Takip_GridDBTableView1CustomDrawCell(
  Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
  AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
begin

 If (Data.AUTO_TABLESATIR_RENGI_UYARISI.asInteger=1) Then Begin
  If Taksit_Takip_GridDBTableView1.Columns[Kolon_ODENEN_TUTAR.Index]=AViewInfo.Item Then Begin
     If AViewInfo.DisplayValue>0 Then Begin
      ACanvas.Font.Color  := clGreen;
      ACanvas.Font.Style:=[Fsbold];
    End;
  End;
 End;

 If (Data.AUTO_TABLESATIR_RENGI_UYARISI.asInteger=1) Then Begin
  If Taksit_Takip_GridDBTableView1.Columns[Kolon_KALAN_TUTAR.Index]=AViewInfo.Item Then Begin
     If AViewInfo.DisplayValue>0 Then Begin
      ACanvas.Font.Color  := clRed;
      ACanvas.Font.Style:=[Fsbold];
    End;
  End;
 End;
End;
Cevapla