EhLib.Com
https://forum.ehlib.com/en/

EHlib7 Column.HideDuplicates=True And onDrawColumnCell (*)
https://forum.ehlib.com/en/viewtopic.php?f=5&t=563
Page 1 of 1

Author:  apsoft [ 04 Mar 2015, 14:38 ]
Post subject:  EHlib7 Column.HideDuplicates=True And onDrawColumnCell (*)

Column.HideDuplicates=True

procedure TForm3.DBGridEh1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
begin
// if (Rect.Top = Column.Grid.CellRect(DataCol,Column.Grid.Row).Top) then
Begin
Column.Grid.Canvas.Brush.Color :=$00EEDDFF;
Column.Grid.Canvas.Font.Style:=Column.Grid.Canvas.Font.Style+[fsBold];
Column.Grid.Canvas.Font.Color :=$00408000;//$00FF0080;// $00EEDDFF;
Column.Grid.DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;

end;


the wrong in 8925 Row on dbgrideh.pas



procedure TCustomDBGridEh.DefaultDrawColumnCell(const Rect: TRect;
DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
var
Value: string;
ARect, ARect1: TRect;
XFrameOffs, YFrameOffs, KeyIndex: Integer;
RowHeight: Integer;
IsCellFilled: Boolean;
MultiLine: Boolean;
begin
ARect := Rect;
if (dghFooter3D in OptionsEh) then
begin
XFrameOffs := 1;
InflateRect(ARect, -1, -1);
end else XFrameOffs := 2;
YFrameOffs := XFrameOffs;
if Flat then Dec(YFrameOffs);
Value := Column.DisplayText;

IsCellFilled := False;
if GridBackgroundFilled and (Canvas.Brush.Color = FInternalColor) then
IsCellFilled := True;
if DataLink.Active and MemTableSupport
then RowHeight := RowHeights[FIntMemTable.InstantReadCurRowNum + TopDataOffset]
else RowHeight := FStdDefaultRowHeight;
if Column.GetBarType in [ctCommon..ctKeyPickList] then
begin
if Column.HideDuplicates and CheckColumnDuplicateValues(Column, FIntMemTable.InstantReadCurRowNum, Value, True) then
Value := '';

CheckColumnDuplicateValues(Column, FIntMemTable.InstantReadCurRowNum, Value, True) ????

FIntMemTable.InstantReadCurRowNum or DataCol ?
......

Attachments:
DBGrid test.rar [57.08 KiB]
Downloaded 363 times

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/