views:

388

answers:

1

Client would like to have row selected so that he can tell what record on the left is being worked on, while being able to edit just 1 column.

so, advise on how to allow row-select plus keypress events to fire, or how to color a cell based on whether another cell in it's row has been entered.

+2  A: 

Coloring distinct cxGrid rows is best done using their Styles collection with OnGetContentStyle event.

procedure StylesGetContentStyle(Sender: TcxCustomGridTableView;
  ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
  out AStyle: TcxStyle);  
begin    
  if SomeCondition then
    AStyle := SomeTcxStyle;  
end;

Another way is by using OnCustomDrawCell event and drawing the grid yourself. I prefer to use styles, it's cleaner.

Mihaela