New to Telerik UI for WinForms? Download free 30-day trial

Adding columns

When the RadListView.ViewType property is set to DetailsView, the data can be displayed in columns view. Adding columns to the control at design time, is done by populating the Columns collection of RadListView. This collection can be accessed either through the Columns property in the property grid of the control or through the Smart Tag of RadListView.

Figure 1: Columns option in Smart Tag

WinForms RadListView Columns option in Smart Tag

Figure 2: Columns option in Properties section

WinForms RadListView Columns option in Properties section

Once ListViewDetailColumn Collection Editor is opened, you can add as many columns as you need, and also, you can modify their properties in the property grid.

Figure 3: ListViewDetailColumn Collection Editor

WinForms RadListView ListViewDetailColumn Collection Editor

Once the Columns collection is populated, you can assign values for each column of each ListViewDataItem, by making use of the SubItems property (this property is available in design-time only):

Figure 4: Fill Cells' Values

WinForms RadListView Fill Cells' Values

Here is the result of the explained operations:

WinForms RadListView Columns

Note if you assign a DataSource programmatically, this will use the default column widths. To handle this scenario, use the ColumnCreating event to access column by field name and set the desired width there.

See Also

In this article