Hi Arrebatrans,
Greetings from Syncfusion support.
We have validated your reported query in the Blazor ListView
component. As per the request we have prepared a simple sample of Blazor
ListView component to meet your requirement. In this sample we have loaded the
list items dynamically when clicking the pager control. We have attached the
modified sample for your reference.
Refer the below code snippet.
|
[Index.razor],
<SfListBox TValue="string[]" TItem="VehicleData" Query="@DataQuery">
<ListBoxFieldSettings Text="Text" Value="Id"
/>
<SfDataManager @ref="DataManagerRef" AdaptorInstance="@typeof(CustomAdaptor)"
Adaptor="Adaptors.CustomAdaptor">
</SfDataManager>
</SfListBox>
<SfPager PageSize="1" TotalItemsCount="3" PageChanged="click">
</SfPager>
@code{
...
public void click(PageChangedEventArgs
args)
{
DataQuery = new Query().Skip((int)(3 *
(args.CurrentPage) - 1)).Take(3);
}
public class CustomAdaptor : DataAdaptor
{
// Performs data Read operation
public override object Read(DataManagerRequest dm,
string key =
null)
{
IEnumerable<VehicleData>
DataSource = Vehicles;
int count =
DataSource.Cast<VehicleData>().Count();
DataSource = DataOperations.Execute<VehicleData>(DataSource, dm);
return
dm.RequiresCounts ? new DataResult() { Result = DataSource, Count = count } : (object)DataSource;
}
}
}
|
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/BlazorApp201406844131.zip
Please check the attached sample and get back to us if you
need any further assistance.
Regards,
Sivakumar S