Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

Makes the item with the specified index visible on screen.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
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