Skip to main content
All docs
V24.1

DxListBox<TData, TValue>.MakeItemVisible(Int32) Method

Makes the item with the specified index visible on screen.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public void MakeItemVisible(
    int visibleIndex
)

Parameters

Name Type Description
visibleIndex Int32

The item’s visible index.

Remarks

Pass the item’s visible index to the MakeItemVisible method to make the item visible on screen. The method scrolls the item list up or down until the item appears.

If you pass an invalid visible index, the method does nothing.

In the following code snippet, a Scroll to the last row button scrolls the item list to the last visible item:

<DxListBox Data="@Staff.DataSource"
           @ref="MyListBox"
           @bind-Values="@Values"
           TextFieldName="@nameof(Person.Text)">
</DxListBox>

<DxButton Text="Scroll to the last row" Click="ScrollToLastRow" />

@code {
    IListBox<Person, Person> MyListBox; 
    IEnumerable<Person> Values { get; set; } = Staff.DataSource.Take(1);

    void ScrollToLastRow()    {
        MyListBox.MakeItemVisible(11);
    }
}

Implements

See Also