Version

Automatically Fit All Columns in Details View

In Details view, WinListView attempts to size all SubItemColumns to the best fit if you don’t set column widths yourself. However, if there’s not enough screen real estate to display all SubItem columns, WinListView will display a scrollbar for your end user to scroll through the data. If scrolling doesn’t appeal to you, or you’d rather have all data displayed at all times, regardless of the width of the columns, you can use the AutoFitColumns property to have WinListView automatically size all columns to fit in the space allotted.

Setting AutoFitColumns to ResizeAllColumns will resize all columns to fit in the allotted space whenever WinListView is resized. WinListView will always use the entire space given to it and all SubItem columns will always be of even width; the MainColumn will always be twice the width of the SubItem columns.

automatically fit all columns in details view of ultralistview

AutoFitColumns set to Default (None)

automatically fit all columns in details view of ultralistview

AutoFitColumns set to ResizeAllColumns

Use the following code sample to have WinListView automatically resize columns in Details view.

In Visual Basic:

Me.UltraListView1.ViewSettingsDetails.AutoFitColumns =_
	Infragistics.Win.UltraWinListView.AutoFitColumns.ResizeAllColumns

In C#:

this.ultraListView1.ViewSettingsDetails.AutoFitColumns =
	Infragistics.Win.UltraWinListView.AutoFitColumns.ResizeAllColumns;