Jump to content

UniDBGRid Record count in Weboptions


misc

Recommended Posts

Hi,

 

i try to display the total record count of the current fetch from my unidbgrid. I display the grid with the weboptions and pagingEnabled=TRUE.

I'd like to show the record count at the same location like the paging controls. Is that possible?

 

Thanks

Link to comment
Share on other sites

Hi Michael Schindler!

 

If I understand correctly, try:

 

UniDBGrid1 -> ....

function pagingBar.beforeInit(sender, config)
{
  sender.displayMsg = 'Total rows {2}';// defaultvalue = 'Displaying {0} - {1} of {2}
  sender.displayInfo = true;
}

post-906-0-61383000-1414136252_thumb.png

 

Best regards.

  • Upvote 1
Link to comment
Share on other sites

Hi Delphi Developer,

 

something in this direction, i dont want to show a message that tells you how many records i have.

On the paging bar, i want to display the record count.

Can i access this component somehow?

 

Thank you

Link to comment
Share on other sites

  • 3 years later...
procedure UniDBGrid1ColumnSummary(Column: TUniDBGridColumn;

  GroupFieldValue: Variant);

begin

      if Column.FieldName <> 'Your field to display count' then

         begin

              if Column.AuxValue = NULL then Column.AuxValue:=0.00;

              Column.AuxValue := Column.AuxValue + (Column.Field.AsFloat)

         end

end;

 


procedure UniDBGrid1ColumnSummaryResult(Column: TUniDBGridColumn;

  GroupFieldValue: Variant; Attribs: TUniCellAttribs; var Result: string);

var

  I : Integer;

  F : Real;

begin

     if SameText(Column.FieldName, 'Your field to display count') then

        begin

             I := UniMainModule.your dataset.RecordCount;

             Result := IntToStr(I);

             Attribs.Font.Style:=[fsBold];

             Attribs.Font.Color:=clGreen;

        end

     else

         begin

              F := Column.AuxValue;

              Result := FormatFloat('#,0.00 ', F);

              Attribs.Font.Style:=[fsBold];

              Attribs.Font.Color:=clNavy;

              Column.AuxValue:=NULL;

         end;

end;

Link to comment
Share on other sites

×
×
  • Create New...