Delphi 获取Grid列属性或列数据

概念

TcxCustomGridTableView:表格

TcxGridDBColumn:表格列

TcxGridTableDataCellViewInfo:数据集

 

 

实例1:表格列新增颜色

procedure Tfrm_ICLYMT01.grd_detDBTableView1movd_partCustomDrawCell(
  Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
  AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
  col: TcxGridDBColumn;
begin
  inherited;
  //工具类物料 颜色
  if AViewInfo.Selected then exit;
  col := GetColumnByName(grd_det, 'gend_property13');
  if (AViewInfo.GridRecord.Values[col.Index] = 'Y') then
    begin
      ACanvas.Font.Color := clblue;
      if not movd_det.IsEmpty then Fset := true;
    end
  else
    ACanvas.Font.Color := clBlack; 

end;
View Code

 

posted @ 2017-03-31 17:16  *ち黑サカ  阅读(499)  评论(0)    收藏  举报