Jump to content


Photo

UniDBGRid Record count in Weboptions

unidbgrid; recordcount; grid;

  • Please log in to reply
3 replies to this topic

#1 Michael Schindler

Michael Schindler

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 95 posts

Posted 24 October 2014 - 05:50 AM

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


  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5177 posts

Posted 24 October 2014 - 07:37 AM

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;
}

Attached File  displayInfo2.png   62.43KB   57 downloads

 

Best regards.


  • 1

#3 Michael Schindler

Michael Schindler

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 95 posts

Posted 24 October 2014 - 08:32 AM

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


  • 0

#4 Fateh_Setif

Fateh_Setif

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 11 May 2018 - 05:30 PM

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;

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users