Back to Devexpress

DxComboBox<TData, TValue>.DataLoadMode Property

blazor-devexpress-dot-blazor-dot-dxcombobox-2-7bd9760a.md

latest3.3 KB
Original Source

DxComboBox<TData, TValue>.DataLoadMode Property

Specifies how the ComboBox loads its data.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(ListDataLoadMode.Auto)]
[Parameter]
public ListDataLoadMode DataLoadMode { get; set; }

Property Value

TypeDefaultDescription
ListDataLoadModeAuto

A ListDataLoadMode enumeration value.

|

Available values:

NameDescription
Auto

The component loads and caches data when the browser loads the web page. Use this mode to improve application responsiveness after initial page load.

| | OnDemand |

The component loads its data whenever a user opens the drop-down window. The component does not cache its data. We recommend using this mode if the page contains multiple ComboBox components and they are bound to large data sources (data queries require resource-intensive operations). In this case, OnDemand mode optimizes page load time and resource usage. Since data is not fetched during component initialization, the page loads faster. By not caching data, the component avoids unnecessary memory consumption (in case the user never needs to open the dropdown).

|

Remarks

The ComboBox supports two load modes:

Auto(default)The component loads and caches data when the browser loads the web page. Use this mode to improve application responsiveness after initial page load.OnDemandThe component loads its data whenever a user opens the drop-down window. The component does not cache its data. We recommend using this mode if the page contains multiple ComboBox components and they are bound to large data sources (data queries require resource-intensive operations). In this case, OnDemand mode optimizes page load time and resource usage. Since data is not fetched during component initialization, the page loads faster. By not caching data, the component avoids unnecessary memory consumption (in case the user never needs to open the dropdown).

Use the DataLoadMode property to switch between modes.

razor
<DxComboBox DataLoadMode="ListDataLoadMode.OnDemand" />

If you enable OnDemand load mode and activate virtual scrolling (ListRenderMode is set to Virtual), the following limitations apply:

  • If the selected item is not in the viewport, the component may not scroll to the selected item when a user opens the drop-down list.
  • If the component uses different TData and TValue types, the component may display the selected item’s text incorrectly on a page load. For example, you have a list of 100 items. The selected item is Item 50. Since the component loads only 20 items initially, the item’s text can not be found and displayed correctly. Only when a user opens the drop-down list, the selected item’s text will be displayed.

See Also

DxComboBox<TData, TValue> Class

DxComboBox<TData, TValue> Members

DevExpress.Blazor Namespace