Quick question

Posts   
 
    
bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 04-Oct-2006 18:29:20   

Hello all,

I would just like to get the number of records returned from a llbldata source self servicing control following a filter to use and subsequent data bind so I can display this to the user and react to it accordingly.

I would like to use paging on and live persistence on, the control does everything for me and I just want to set the filter and get the result :-).

I can get this value by reusing my filter and a count call, but why should I have to call the search twice just to get a count property :-)

Hopefully this is an easy one,

Regards,

Matthew

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 05-Oct-2006 02:24:55   

You may want to look in the manual under Generated code - Entity collection and Typed List/Typed View paging, SelfServicing. GetDbCount() will be needed.

The first query that you run will only return one page worth of data and won't care about how much data that query could possibly return. So the data in the collection can't be used for a total. So you have to run a count query for all records that meet the criteria.

bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 05-Oct-2006 10:39:48   

Okay, I will use the collection object.

Could you explain how the data Grid knows how many record/pages of information it is holding if the total number of records is not available anywhere?

Regards,

Matthew

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-Oct-2006 16:35:53   

LLBLGen Pro DataSource performs GetDBCount(), and you may use LivePersistance = false, and handle the event PerformGetDbCount().

And then use the DbCount property of the PerformGetDbCountEventArgs.