Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6051771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:51:17+00:00 2026-05-23T07:51:17+00:00

In my little app there’s a button that once getting clicked, the fifth item

  • 0

In my little app there’s a button that once getting clicked, the fifth item in the listview getting selected.

the problem is that its out of the listview scope and I would like the vertical scroll bar to slide down to the so I can see the selected item.

How can I do that ?

enter image description here

XAML:

<StackPanel>
    <Button Click="Button_Click">Find number 5</Button>
    <ListView x:Name="lst" ScrollViewer.VerticalScrollBarVisibility="Visible" Height="50">
        <ListView.Items>
            <ListViewItem>1</ListViewItem>
            <ListViewItem>2</ListViewItem>
            <ListViewItem>3</ListViewItem>
            <ListViewItem>4</ListViewItem>
            <ListViewItem>5</ListViewItem>
            <ListViewItem>6</ListViewItem>
            <ListViewItem>7</ListViewItem>
        </ListView.Items>
    </ListView>
</StackPanel>

C# code:

public partial class Window2 : Window
{
    public Window2()
    {
        InitializeComponent();
    }

    private void Button_Click(object sender, RoutedEventArgs e)
    {
        ((ListViewItem)lst.Items[4]).IsSelected = true;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:51:17+00:00Added an answer on May 23, 2026 at 7:51 am

    Use ListView.ScrollIntoView to achieve what you want:

    lst.ScrollIntoView(lst.SelectedItem);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a little app, and there's a small UIWebView there. The problem is
Hey there, i am trying to make a little app that will serve multiple
I just began working on a little twitter-app using tweepy. is there any kind
I'm writing a little app that displays some graphics and just now I'm trying
I have a little app that have by default youtube as homepage. You can
I have a little app up that has both CCLayer view and UIView. That
I've just created a little app that programmatically compiles code using the C# Compiler,
I am learning flex and have written a little app with a TextArea that
I have a little app (PHP/MySQL) to manage condos. There's a condos table, apartments
I'm creating a little app that configures a connected device and then saves the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.