Page 1 of 1

MyDAC, TCRDBGRID, dgeRecordcount and dgeSummary

Posted: Thu 30 Dec 2004 15:55
by calix
Hy,

i need in tcrDBGrid both options: dgeRecordcount and dgeSummary at one time.
When enabling dgeRecordcount and dgeSummary, it seems the Recordcount-Field n/xxx overwrites the other Summary-Fields.
Is this a bug or is it a feature. :wink:

May you can add a new Summary-Mode smRecordCount?

Regards
Harald

Posted: Thu 30 Dec 2004 16:53
by calix
I´ve modified the source in CRGrid like that. May you implement in your next release.

CRGrid.pas Line 2475
:idea:

Code: Select all

if dgeRecordCount in FOptionsEx
then begin
  CellRect := FullRect;
  InflateRect(CellRect, -2, -2);
  //HAK 30.12.2004 This will paint the Field to the whole line
  //CellRect.Right := RightBorder;
  if DataLink.Active then
      tmpText := IntToStr(DataLink.DataSet.RecNo) +
        ' / ' + IntToStr(DataLink.DataSet.RecordCount)
  else
      tmpText := '';//'Records count : INACTIVE';

  //HAK 30.12.2004 This will paint the Field as needed  
  CellRect.Right := Canvas.TextWidth(tmpText);
  WriteText(Canvas, CellRect, 0, 0, tmpText, taLeftJustify,True);
end;
Regards Harald
PS: have a happy new year, and thanks for your good work!!! :D

Posted: Wed 05 Jan 2005 10:01
by Alex
"TCRDBGrid.OptionsEx" topic in CRDBGRID help says that "dgeSummary is mutually exclusive with dgeRecordCount option." It happens because of paint confrontation in these modes.
Your suggestion doesn't resolve this problem so we decide to reject it.

Posted: Wed 05 Jan 2005 10:29
by Guest
But for the most cases, it works very fine and the paint-confrontation, is much lesser.

How do you think about a new summary type smCount?

Posted: Wed 05 Jan 2005 15:08
by Alex
We couldn't support features that work in some, possible, most cases, but in the rest cases cause problems.
As to your second question - we are planning to add a new functionality to CRDBGrid but not in the nearest time.