$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
ListView WinForms Control
Create elegant user interfaces, display data, group, filter, sort, and customize data items
Home > WinForms UI Controls > User Manual > Add Columns in ListView in C#

Add Columns in ListView in C# at Design Time

The ListView Controls for Windows Forms provide design-time support functionality to developers. This feature allows developers easily choose a data source or populate it with unbound items, groups and columns when design the user interface for their Windows Form applications. The users can easily add columns to ListView, group items in ListView, and add items to ListView at design time in C#.NET templates

How to Add Columns to ListView at Design Time

To add columns to Kettic ListView, we need to change the view type to DetailsView for Kettic ListView. And the WinForms control is able to display the data in columns views. The columns can be added to the ListView WinForms component at design time by populating the Columns collection of Kettc ListView. The following steps shows how to add columns to ListView control
  1. To access the Column collection, we can use the Columns property in the property of the component or use the Smart Tag of the of Kettic ListView WinForms control.
  2. When opening the ListViewDetailColumn collection editor, we can add any number of columns as necessary
  3. To modify the columns, we can customize the properties in the property grid
  4. When populating the Columns collection, we can customize the sub items at design time by assigning values for each column of each ListViewDataItem through the SubItems property
  5. Run the applications, you will see the columns that have been added to the list view.

Customize Columns in ListView in C#.NET

After we add a column to the ListView .NET control, the CreateColumn event will be fired. This event is able to hide the unwanted columns and create custom columns with more user friendly headers. The C# code below shows how to customize the columns.

void ketticListView1_ CreateColumn(object sender, ListView CreateColumnEventArgs e)
{
if (e.Column.FieldName == "ProductID" || e.Column.FieldName == "ProductImage")
{
e.Column.Visible = false;
}

if (e.Column.FieldName == "ProductName")
{
e.Column.HeaderText = "Quantity";
}

if (e.Column.FieldName == "Category")
{
e.Column.HeaderText = "Price";
}

if (e.Column.FieldName == "Production")
{
e.Column.HeaderText = "Price";
}
}

UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls