DBGride控件5.2修改版,主要是针对DBGrideh.pas做了一些修改,增加了几个属性,解决了DBGRIDEH分组合并的问题。 增加属性如下: DirectMultiSelect 行多选允许时,不按shift即多选 DisplayZero 数字字段,零值要不要显示,为false时显示成空 mergeFields 指字
增加属性如下:
DirectMultiSelect 行多选允许时,不按shift即多选
DisplayZero 数字字段,零值要不要显示,为false时显示成空
mergeFields 指字要合并的列,列名之间用分号格开,方便指定合并的列
SucMergeField 顺序合并列,若第一,二要合并的列有一个不能与上行合并的,那么第三列即便与上一行可合并,也不会再合并(这个可能比较有用)
ColumnEH 增加 IsGraphic属性,可以打开数据集前指示某列为图片(当然前提是这列为BlobField),从而在 DBGRIDEH中drawGriphicdata打开的情况下,直接绘出图片,图片格式支持 JPEG,WMF,ICO,BMP;你也可以增加Gif支持,只在找到 //gfGif:Result:=TJvGIFImage.Create; 去掉备注,加上引用单元即可……
Grid Delphi
function TDBGridEhStyle.HighlightNoDataCellColor(AGrid: TCustomDBGridEh; ACol, ARow, DataCol, DataRow: Integer; CellType: TCellAreaTypeEh; AState: TGridDrawState; InMultiSelect: Boolean; var AColor: TColor; AFont: TFont): Boolean; begin Result := False; if InMultiSelect then begin if ((CellType.HorzType = hctIndicatorEh) and (CellType.VertType <> vctAboveFooterEh)) or ((CellType.HorzType <> hctIndicatorEh) and (CellType.VertType in [vctTitleEh, vctSubTitleEh])) or ((CellType.HorzType <> hctIndicatorEh) and (CellType.VertType = vctFooterEh) and (AGrid.FooterColor = AGrid.FixedColor)) then begin AColor := RGB(64, 64, 64); AFont.Color := clWhite; end else if AGrid.IsSelectionActive then begin if LuminateSelection and (FScreenNumColors = -1) then // AColor := FLuminateSelectionColor AColor := LightenColor(AColor, clHighlight, True) else begin AColor := clHighlight; AFont.Color := clHighlightText; end; end else if (FScreenNumColors = -1) then AColor := LightenColor(AColor, clBtnShadow, False) else AColor := clBtnFace; Result := True; end; end;