Power Community

Power Community

How To count rows for gallery with more than 100 records

image

One of the recommended ways to count number of items in a gallery control is:

gallery1.AllItemsCount

However, this has a limitation that it can only show count of 100.

When the user scrolls the gallery further, the count updates in an increment of 100.

This may not be an effective way to show total number of items.

Solution:

We create a hidden gallery and set the default property to last item.

This simulates the action of scrolling all the way to the end.

We then count the number of records in this hidden gallery.

Here is a step by step guide:

1 – Add a new gallery control – gallery2

2 – Within the Items property of gallery2, copy the same code from the Items property of the original gallery (gallery1). Do NOT use gallery1.AllItems

3 – We don’t have to add any controls within this new gallery (gallery2)

4 – Add default property for gallery2 as:

Last(Self.AllItems)

5 – Hide the new gallery (gallery2) by setting Visible property to false

6 – Add a label and set property to:

gallery2.AllItemsCount

This way you have simulates the action of scrolling all the way to the end in gallery2 without impacting your user experience. Since you have scrolled all the way to the end, you can get accurate count for number of items in the datasource.

This post was originally published on this site

- Advertisement -spot_img

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement - Advertisement

Latest News

Unpacking the VMware Rapid Migration Plan

Allie Wolf Allie is the Marketing Manager at Dynamic Consultants Group. She graduated from Northwest Missouri State University with...

More Articles Like This

- Advertisement -spot_img