cxGrid使用经验--不同的颜色

 

procedure TfrmOrderMgr.grdVMainStylesGetContentStyle(
  Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
  AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
var
  AIndex: Integer;
  AVar: Variant;
  ABoolean: Boolean;
  lvItem: TcxGridDBColumn;
begin
  lvItem := TcxGridDBColumn(AItem);

  if grdVMainFCompleted.GroupIndex <> -1 then Exit; //分组时不分颜色

  AIndex := grdVMainFCompleted.Index;
  AVar := ARecord.Values[AIndex];
  if VarIsOrdinal(AVar) then ABoolean := AVar else ABoolean := false; //是否为bool值

  if ABoolean then  //已完成
    AStyle := dmMain.cxStyleRecCompleted else AStyle := dmMain.cxStyleRecNormal;

  if lvItem.VisibleIndex = 0 then //第一列
  begin
    AIndex := grdVMainFClosed.Index;
    AVar := ARecord.Values[AIndex];
    if VarIsOrdinal(AVar) then ABoolean := AVar else ABoolean := false; //是否为bool值
    if ABoolean then  //已取消
      AStyle := dmMain.cxStyleRecClosed;
  end;
end;

上一篇:视觉会议收藏一


下一篇:我的Android进阶之旅------>启动Activity的标准Action和标准Category