Skip to main content
All docs
V23.2

DxListBox<TData, TValue>.BeginUpdate() Method

Suspends List Box updates caused by parameter changes and method calls until the EndUpdate() method is called.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public void BeginUpdate()

Remarks

You can use BeginUpdate() and EndUpdate() methods to change values of the List Box parameters outside the component markup.

The code below changes the ReadOnly parameter value.

<DxListBox Data="forecasts"
           TextFieldName="@nameof(WeatherForecast.Summary)"
           @ref="component"
           @bind-Values="values"/>
<br/>
<DxButton Text="MakeReadOnly" Click="@MakeReadOnly"></DxButton>

@code {
    private IListBox<WeatherForecast, WeatherForecast> component;

    private IEnumerable<WeatherForecast> forecasts;
    private IEnumerable<WeatherForecast> values;

    protected override async Task OnInitializedAsync() {
        forecasts = await ForecastService.GetForecastAsync(DateOnly.FromDateTime(DateTime.Now));
    }

    void MakeReadOnly() {
        component.BeginUpdate();
        component.ReadOnly = true;
        component.EndUpdate();
    }
}

Implements

See Also