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.
Try this…
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
Scrollbarclass but it has no resourceKey! This means all scroll bars under thatListViewwill 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.