I am displaying a table in a btvView. When the value in the 'Code' column = '1' I want two columns (the 'Lastname' column and the 'Firstname' column to have red backgrounds and white text. I have the following code in the OnCustomDrawCell event:
if ( TcxGridDBBandedColumn( AViewInfo.Item.DataBinding.FieldName = 'Code' ) and ( AViewInfo.Value = '1' ) then
if ( TcxGridDBBandedColumn( AViewInfo.Item ).DataBinding.FieldName = 'Lastname') or
( TcxGridDBBandedColumn(AViewInfo.Item ).DataBinding.FieldName = 'Firstname') ) then
begin
AViewInfo.EditViewInfo.BackgroundColor := clRed;
AViewInfo.EditViewInfo.TextColor := clWhite;
end;
AViewInfo.EditViewInfo.Paint( ACanvas );
ADone := true;
This appropriately paints either the 'Lastname', column or the 'Firstname' column but not both according to which one is in focus. How can I make both columns paint as specified?
Thanks,
Jim Sawyer