Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
WPF GridView 列の幅をコンテンツに合わせて自動調整するにはどうすればよいですか?
各列の幅を に設定しますDouble.NaN。ただし、最初にそれ以外に設定してください。
Double.NaN
foreach (GridViewColumn c in MyGridView.Columns) { c.Width = c.ActualWidth; c.Width = Double.NaN; }