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

  • Home
  • SEARCH
  • 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 6978449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:45:29+00:00 2026-05-27T17:45:29+00:00

I have a listview which is binded to source. It is working fine. I

  • 0

I have a listview which is binded to source. It is working fine. I have set ScrollViewer.VerticalScrollBarVisibility=”Auto”, so that if there is no space to show the items, it should display the scroll bar.

Upto this it is working fine. It is showing the vertical scroll bar, but it is including the header of GridViewColoumn also. It is looking odd.

So how to show the vertical scrollbar only for the contents, not with header?

Any idea will be helpful.

  • 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-27T17:45:30+00:00Added an answer on May 27, 2026 at 5:45 pm

    Try this…

            <ListView.Resources>
                <Style TargetType="{x:Type ScrollBar}"
                       BasedOn="{StaticResource {x:Type ScrollBar}}">
                    <Style.Triggers>
                        <Trigger Property="Name" Value="PART_VerticalScrollBar">
                            <Setter Property="Margin" Value="0,18,0,0"/>
                        </Trigger>
                    </Style.Triggers>                   
                </Style>
            </ListView.Resources>
    

    EDIT:

    To understand how this works first you will have to refer this msdn article that gives you the default template of the list view … http://www.google.co.in/url?q=http://msdn.microsoft.com/en-us/library/ms788747(v%3Dvs.85).aspx&sa=U&ei=r_L6TuXlJ8XyrQep_anODw&ved=0CBQQFjAC&sig2=HNWppacyWyhYxn2NcUSbEw&usg=AFQjCNHzlst2jA_pMTzZsUGNxtbWBqYQLQ

    In this template we have the verticle scroll bar defined with name PART_VerticalScrollBar.

    Now if you want to change its properties such as Margin, you will have to set a default target type style for the scroll bar. In our example above, the targetType of the style is Scrollbar class but it has no resource Key! This means all scroll bars under that ListView will acquire the style and set their top margin to 18px. But we dont want it to apply to all scroll bars so I added a trigger that only targets this style to scrollbar with name “PART_VerticalScrollBar”.

    Let me know if this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a listview which I have binded (twoWay) to a datatable. The binding
I have a listview which is populated by a SimpleCursorAdapter that is binding data
I have a ListView in which i have a function that creates images for
I have a listview that is binded to a ThreadSafeObservableCollection. The background of each
I have a ListView which contains a text field that is populated using a
I have a listview which I populate from a webservice query. Problem is that
I have a ListView which has been constructed, styled and had an adapter set
I have a TextBox and a DropDown inside a ListView which is binded to
I have a ListView which sometimes I need to put around 10000 items in.
I have a ListView which is using a GridView to display a DataTable and

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.