Hi, i'm using a MultiSelect and it's firing the method to load data at initialize, but this is not the normal behavior for the DropDown and Combobox
The problem is that at initial Load it does grab all records, slowing down
I'v set the EnableVirtualization to true and ItemsCount as 10 but it doesn't seems to affect the first data load
this is the configuration i'm using:
Note that on the first load of Data the Skip and Take are 0:
The list contains around 600 items, so it's to heavy to the UI
Shouldn't the virtualization enabled make the component call just the data t
Also, is there a feature request for the DropDowns, Combox and Multiselect to have a
ImmediateModeDelay property on filters like Grids have?
|
<div id="ControlRegion">
<SfDropDownList TValue="string" TItem="Order" Query="@Query" EnableVirtualization="true">
<SfDataManager AdaptorInstance="@typeof(CustomAdaptor)" Adaptor="Adaptors.CustomAdaptor"></SfDataManager>
<DropDownListFieldSettings Value="@nameof(Order.OrderID)" Text="@nameof(Order.CustomerID)"></DropDownListFieldSettings>
</SfDropDownList>
</div>
@code{
public Query Query = new Query().Take(20);
protected override void OnInitialized()
{
//Orders = dbContext.Orders.ToList();
}
public class CustomAdaptor : DataAdaptor
{
public OrderContext dbcontext { get; set; }
public CustomAdaptor(OrderContext orderContext)
{
dbcontext = orderContext;
}
// Performs data Read operation
public override object Read(DataManagerRequest dm, string key = null)
{
IEnumerable<Order> DataSource = dbcontext.Orders;
if (dm.Search != null && dm.Search.Count > 0)
{
// Searching
DataSource = DataOperations.PerformSearching(DataSource, dm.Search);
}
if (dm.Sorted != null && dm.Sorted.Count > 0)
{
// Sorting
DataSource = DataOperations.PerformSorting(DataSource, dm.Sorted);
}
if (dm.Where != null && dm.Where.Count > 0)
{
// Filtering
DataSource = DataOperations.PerformFiltering(DataSource, dm.Where, dm.Where[0].Operator);
}
int count = dbcontext.Orders.Count();
if (dm.Skip != 0)
{
//Paging
DataSource = DataOperations.PerformSkip(DataSource, dm.Skip);
}
if (dm.Take != 0)
{
DataSource = DataOperations.PerformTake(DataSource, dm.Take);
}
return dm.RequiresCounts ? new DataResult() { Result = DataSource, Count = count } : (object)DataSource;
}
}
}
|