Hi,
We can color up grid lines by using displayOption. On forms datasource expand methods click right mouse ,select overwirte function and select displayOption.
For code example open tuttorial_Form_displayOptions form
public void displayOption(Common _common, FormRowDisplayOption _options)
{
// here's the logic which derteminates the color for this row
// In this case it will random color the lines
if (_common.recId mod 3 ==0)
{
_options.backColor( WinAPI::RGB2int( 255,0,0 ));
}
super(_common,_options);
}
With this code example if recId's mod is equal to 3 it will paint the entire row to red. But if we want to paint only one cell individually we will use
_options.affectedElementsByControl(CustTable_Name.id());
As you can see we used affectedElementsByControl method to paint only sellected control.
Happy Axing.
Alper.
////////////////////////////////////////////////////////////////////
Merhabalar,
Form üzerindeki gridlerde istenilen koşula göre renklendirme yapmak istediğimizde form veri kaynağı üzerinde bulunan displayOption methodunu ezeceğiz.
Methodu ezmek için form un altında yer alan veri kaynağının methodlarını genişletip yöntemi geçersiz kıl ı seçtikten sonra açılan listeden displayOption ı seçiyoruz.
Örnek kod olarak tuttorial_Form_displayOptions formunu kullabiliriz.
public void displayOption(Common _common, FormRowDisplayOption _options)
{
// here's the logic which derteminates the color for this row
// In this case it will random color the lines
if (_common.recId mod 3 ==0)
{
_options.backColor( WinAPI::RGB2int( 255,0,0 ));
}
super(_common,_options);
}
Bu örnekte custtable ın RecId alanının değerinin mod 3 e göre değeri 0 olduğunda kayıdın bulunduğu satırı tümüyle kırmızıya boyuyor.
Eğer tüm satırı değilde sadece tek bir alanı boyamak istersek koda alttaki satırı eklememiz yeterli.
_options.affectedElementsByControl(CustTable_Name.id());
Bu şekilde affectedElementsByControl methodunu çağırarak boyama işleminin sadece parametre olarak gönderdiğimiz CustTable_Name.id() konrolü için geçerli olduğunu belirtiyoruz.
Mutlu AXlar,
Alper.
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder