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 9251271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:39:15+00:00 2026-06-18T10:39:15+00:00

I have a WPF ListView. This ListView will contain n-items. As a user drags

  • 0

I have a WPF ListView. This ListView will contain n-items.

As a user drags something into the listview, I am displaying a horizontal bar on the AdornerLayer of the ListView to show the index where the item will be inserted.

I also am auto-scrolling the listView. Because ScrollViewer.CanContentScroll=”False” ListViewItems are partially visible.

The problem I am having is that the indicator bar that I am drawing is appearing outside of the bounds of the ListView (in my case above) when the ListViewItem I am over is at the top and only partially visible.

The trigger to draw the bar is to take whatever ListViewItem I am currently hovering over, grab it’s top bounds value and draw the line. When the ListViewItem is not fully visible yet, the bar is draw above the ListView itself and obviously looks weird.

Summary: Trying to determine if a given ListViewItem is only Partially visible in a ListView.

In this case, code is not really all that relevant but I can post some if you like.

Thanks

  • 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-06-18T10:39:16+00:00Added an answer on June 18, 2026 at 10:39 am

    You can probably use a combination of ScrollViewer.VerticalOffset or ScrollViewer.ViewPortHeight and the listviewitem’s location with respect to the listview itself

    itemPosition = ListViewItem.TransformToAncestor(ListView).Transform(new Point(0, 0));
    

    To tell if it is fully visible you should just need to do the following

    itemPosition.Y + itemHeight - viewPortHeight
    

    Then if that value is between the itemHeight or -viewPortHeight, then it is visible

    OR, what is probably a little cleaner:

    (-itemPosition.Y < itemHeight && itemPosition.Y < viewPortHeight)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm displaying a list of items in a WPF ListView, the items have a
Couldn't find an answer to this one. I have a WPF ListView control that
I have a WPF ListView with many items in it. When I select several
I have a WPF ListView that I am trying to filter within a BackgroundWorker.
I have a WPF ListView that should be extended with an always visible footer.
Possible Duplicate: WPF Listview Access to SelectedItem and subitems I have a listview defined
I have a strange behavior with my WPF ListView Control. ListViews ItemSource is Observable
so I have attached a context menu (right-click menu) to a wpf listview. unfortunately,
I have a WPF App that implements a ListView. I would like to show
I have a ListView in a WPF window containing a number of GridViewColumns. 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.