How to have a dynamically resizing GridViewColumn that scales based on the size of the largest item in the ListView in WPF?
Currently I have some GridViewColumns that use Auto for their Width property, but this only seems to work on startup. After I add new values to the ListView, the GridVi开发者_开发技巧ewColumns using Auto don't adjust their width.
Any idea on how to do this?
Wrongly understand your meaning ;(
you should set the width by code
Here you are: How to autosize and right-align GridViewColumn data in WPF?
fire it up to blend to ease your design process, or click off the clips with "8" signs then it will not drag follow with the size of window (in total of 4 clips and 4 sides)
also make the horizontal scroll bar become visible, then it will add up value and scrollable =D
What are the other columns sizes set to? If they are fixed then the Auto sized column will only be able to grow up to the maxwidth minus those column widths. Have you tried setting their column sizes to *?
-Matt
精彩评论