$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 > Bind ListView to Data in C#

Populating with Data in ListView Control in C#.NET

Kettic ListView .NET control is capable of binding to data source to display those data. There are three properties available for the users to bind ListView to data, the DataSource, ShowMember, and ValueMember. The DataSource property is used to specify the data source that the ListView will be bound to, the ShowMember displays the specific data in a ListView, and the ValueMember returns the value of a ListView from the specific data.

How to Insert Items to ListView in C#.NET

To add items to ListView control in C#.NET, we need to use the Item property, which allows the users to access the columns of Kettic ListView in a collection. The Add method will be able to add columns to Kettic ListView control. The C# code below shows how to accomplish this.

this.ketticListView1.Items.Insert(new ListViewDataItem("Item 1"));
this.ketticListView1.Items.Insert("Item 2");

How to Add Columns to ListView in C#.NET

Kettic ListView control contains the Columns property for the users to access to the columns of Kettic ListView in a collection. If we add columns to the Kettic ListView control, we need to use one of the overloads of the Add method and the column should have the unique name to distinguish each other.

this.ketticListView1.Columns.Add("Column2", "Column2Header");
this.ketticListView1.Columns.Add(new ListViewDetailColumn("Column3", "Column3Header"));

How to Populate Cells in ListView in C#.NET

The following is the C# code that demonstrates how to populate cells in ListView in C#.NET. Here, we need to add the item to the ListView component before assigning values to cells.

ListViewDataItem item = this.ketticListView1.Items[0];

item[0] = "CellValue1";
item["Column2"] = "CellValue2";
item[ketticListView1.Columns[2]] = "CellValue3";

How to Add Groups to ListView in C#.NET

Kettic ListView control is capable of adding groups not only by using GroupDescriptors, but also adding custom groups. This can be accomplished through the Add method of the Groups collection of Kettic ListView component. The C# code below shows how to add groups to ListView control.

this.ketticListView1.Groups.Add(new ListViewDataItemGroup("Group A"));
this.ketticListView1.Groups.Add(new ListViewDataItemGroup("Group B"));
And the C# code below demonstrates how to assign an item to a group by setting the item’s Group property.

this.ketticListView1.Items[0].Group = this.ketticListView1.Groups[0];
this.ketticListView1.Items[1].Group = this.ketticListView1.Groups[0];
this.ketticListView1.Items[2].Group = this.ketticListView1.Groups[1];
this.ketticListView1.Items[3].Group = this.ketticListView1.Groups[1];
The custom grouping can be enabled by change the value of the EnableCustomGrouping property to true and the groups can be shown by enabling the DisplayGroups property.
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