[DevExpress Support Team: CLONED FROM T1084394: Xaf Blazor - Dashboard View - Count record in nested listiview.]
Sorry I have one last question on this.
The controller works perfectly if my view are in data access mode "Client".
Currently in Queryable, the count is not taking the criteria in consideration.
What should I do to get the count if my views are in Queryable dataccess mode ?
A ObjectSpace.GetObjectsCount directly ?
Thanks again for your help.
BR
ISA
Hello,
Please allow us additional time to research why the GetCount() method doesn't return the correct value in this usage scenario. We will update this thread once we have news. Currently, you can use the following code to get the required result:
using DevExpress.ExpressApp; using System; using System.Linq; namespace DXApplication1.Module.Blazor.Controllers { public class BlazorDashboardCaptionController : ViewController<ListView> { protected override void OnViewControlsCreated() { base.OnViewControlsCreated(); var listView = this.View; // int count = listView.CollectionSource.GetCount(); var queryCollection = View.CollectionSource.Collection as QueryableCollection; if(queryCollection != null) { int count2 = View.ObjectSpace.GetObjectsCount(View.ObjectTypeInfo.Type, queryCollection.Criteria); } } } }
Please let me know if this solution meets your requirements.
Thanks,
Andrey