Skip to main content
All docs
V23.2

DxComboBoxSettings.ListRenderMode Property

Specifies whether virtual scrolling is enabled in the combo box editor.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(ListRenderMode.Entire)]
[Parameter]
public ListRenderMode ListRenderMode { get; set; }

Property Value

Type Default Description
ListRenderMode Entire

An enumeration value.

Available values:

Name Description
Entire

The editor renders the entire item list. Use this option for small item lists where scrolling should be instant.

Virtual

The editor renders list items only after they appear in the viewport. This approach improves performance when the list contains many items.

Remarks

In virtual scrolling mode, the combo box editor renders items in the drop-down list only after they appear in the viewport. Enable this mode when the combo box contains a large number of items to improve editor performance.

Note

When the combo box editor is in virtual scrolling mode, drop-down list width can change while the user scrolls the list up or down.

The example below demonstrates how to enable the virtual scrolling mode in a combo box editor:

@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory

<DxGrid Data="Orders"
        EditMode="GridEditMode.EditRow">
    <Columns>
        <DxGridCommandColumn />
        <DxGridDataColumn FieldName="EmployeeId" Caption="Employee" Width="20%">
            <EditSettings>
                <DxComboBoxSettings Data="Employees"
                                    TextFieldName="LastName"
                                    ValueFieldName="EmployeeId"
                                    ListRenderMode="ListRenderMode.Virtual" >
                </DxComboBoxSettings>
            </EditSettings>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="ShippedDate" />
        <DxGridDataColumn FieldName="ShipCountry" />
        <DxGridDataColumn FieldName="ShipCity" />
        <DxGridDataColumn FieldName="ShipName" Width="20%" />
    </Columns>
</DxGrid>

@code {
    NorthwindContext Northwind { get; set; }
    List<Order> Orders { get; set; }
    List<Employee> Employees { get; set; }

    protected override async Task OnInitializedAsync() {
        Northwind = NorthwindContextFactory.CreateDbContext();
        Orders = await Northwind.Orders.ToListAsync();
        Employees = await Northwind.Employees.ToListAsync();
    }

    public void Dispose() {
        Northwind?.Dispose();
    }
}

To enable or disable the virtual scrolling mode in the combo box at runtime, use the IComboBoxSettings.ListRenderMode property.

Implements

See Also