Solved

How to get the count of visible rows in grid?

  • 16 June 2022
  • 8 replies
  • 682 views

I want to get count of all visible records on grid. If I will filter it for ex. by Vendor record count will change and I want that count not from BQL select;

icon

Best answer by Naveen Boga 16 June 2022, 20:58

View original

8 replies

Userlevel 7
Badge +5

Just to be clear what you’re asking for: You want to know how many records that your grid can display on one screen or you want to know how many records that the grid’s underlying view is ‘holding’ due to filtering conditions.

I want to know how many records that the grid’s underlying view is ‘holding’ due to filtering conditions

Userlevel 5
Badge +1

@NikaKakhetelidze 

Trick is here it add the PagerSettings tag highlighted in the red in the aspx page. 

<px:PXGrid ID="grid" runat="server" DataSourceID="ds" ... >

<Levels>

<px:PXGridLevel DataMember="...">

<Columns>

</Columns>

</px:PXGridLevel>

</Levels>

<ActionBar PagerVisible="Bottom">

<PagerSettings Mode="NumericCompact" />

</ActionBar>

</px:PXGrid>

Refer the below link for more info. 

Page Number on Acumatica Grid - Acumatica Developers Blog

 

@NikaKakhetelidze

Trick is here it add the PagerSettings tag highlighted in the red in the aspx page. 

<px:PXGrid ID="grid" runat="server" DataSourceID="ds" ... >

<Levels>

<px:PXGridLevel DataMember="...">

<Columns>

</Columns>

</px:PXGridLevel>

</Levels>

<ActionBar PagerVisible="Bottom">

<PagerSettings Mode="NumericCompact" />

</ActionBar>

</px:PXGrid>

Refer the below link for more info. 

Page Number on Acumatica Grid - Acumatica Developers Blog

 

 

@Vinay Koppula Thank you for Reply

Yeah I know that, but I want to do this at acumatica pages and not custom. so I cannot just edit aspx and <PagerSettings Mode="NumericCompact" /> this part is not available for customization.

So what I am trying here is to add int Field at Filter and put amount there

 

Only this option is available PageVisible Property and that’s it. I cannot Find <PagerSettings Mode="NumericCompact" />

Userlevel 7
Badge +17

Hi @NikaKakhetelidze   Here is the article was written by Sergey along with an example to display the Row Count along with the pages.

Hope this helps.

https://asiablog.acumatica.com/2018/07/page-number-on-acumatica-grid.html

Hi @NikaKakhetelidze. You can also try this solution. I my case you can this with customization package as well, without changing site’s files. I tried to implement this on MRP Exceptions (AM403000). First of all we need to add new field to the Grid table. In my case I added unbound field to the AMRPExceptions.

DAC extension

Then we need to override a graph to fill this new field with count row data.

Graph Extension

 

After all of this we need to change a bit page by customization editor. For the grid object we need to setup a StatusField 

As a result, we will have 

Also, when we will filtered our data by using column filter it will be recalculated 

Hi @NikaKakhetelidze. You can also try this solution. I my case you can this with customization package as well, without changing site’s files. I tried to implement this on MRP Exceptions (AM403000). First of all we need to add new field to the Grid table. In my case I added unbound field to the AMRPExceptions.

DAC extension

Then we need to override a graph to fill this new field with count row data.

Graph Extension

 

After all of this we need to change a bit page by customization editor. For the grid object we need to setup a StatusField 

As a result, we will have 

Also, when we will filtered our data by using column filter it will be recalculated 

I found some issue with few pages in the grid. To solve we need to change a bit select delegate.

 

protected virtual IEnumerable exceptRecs()        

{            

var selectLines = new PXSelect<AMRPExceptions>(Base);            

int startRow = PXView.StartRow;            

int totalRows = 0;            

var result = selectLines.View.Select(PXView.Currents, PXView.Parameters, PXView.Searches,                 PXView.SortColumns, PXView.Descendings, PXView.Filters, ref startRow, PXView.MaximumRows, ref totalRows);            

PXView.StartRow = 0;            

 

//select for total rows            

int startAllRow = 0;            

int totalAllRows = 0;            

var resultAllRows = selectLines.View.Select(PXView.Currents, PXView.Parameters, PXView.Searches,                 PXView.SortColumns, PXView.Descendings, PXView.Filters, ref startAllRow, int.MaxValue, ref totalAllRows);            

rowCount = totalAllRows;            

 

return result;        

}

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved