Joan Venge
Joan Venge

Reputation: 331460

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 GridViewColumns using Auto don't adjust their width.

Any idea on how to do this?

Upvotes: 1

Views: 2214

Answers (2)

1myb
1myb

Reputation: 3596

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

Upvotes: 1

Stein
Stein

Reputation: 1

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

Upvotes: 0

Related Questions