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

Add Items to 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 Items to ListView at Design Time

To add items to Kettic ListView at design time, we need to use the Items collection of the ListView control. The following steps shows how to add items to ListView control
  1. Access the Items collection of the ListView control via the property of the component or the Smart Tag of the of Kettic ListView control.
  2. When opening the ListViewDataItemCollectionEditor, we can add items to the collection by using the Add button.
  3. To modify the added items, we can customize the properties in the property grid
  4. Run the applications, you will see the added items in the list view.

Customize ListView Items in C#.NET

After adding items to the ListView control, we can customize the visual item in C# code by handling the FormatVisualItem event. We need to assign the visual item image and set visual item text to ProductName, Category, and Price for IconsView. The C# code below shows the customization.

void ketticListView1_FormatVisualItem(object sender, Kettic.WinForms.UI.ListViewVisualItemEventArgs e)
{
if (e.VisualItem.Data.Image != null)
{
e.VisualItem.Image = e.VisualItem.Data.Image.GetThumbnailImage(32, 32, null, IntPtr.Zero);
e.VisualItem.Layout.RightPart.Margin = new Padding(2, 0, 0, 0);
}

if (this.ketticListView1.ViewType == Kettic.WinForms.UI.ListViewType.IconsView && e.VisualItem.Data.DataBoundItem != null)
{
string categoryName = ((MusicCollectionDataSet.sDataTableRow)(((System.Data.DataRowView)(e.VisualItem.Data.DataBoundItem)).Row)).CategoryName;
string productName = ((MusicCollectionDataSet.ProductsDataTableRow)(((System.Data.DataRowView)(e.VisualItem.Data.DataBoundItem)).Row)).ProducttName;
string productName = ((MusicCollectionDataSet.ProductsDataTableRow)(((System.Data.DataRowView)(e.VisualItem.Data.DataBoundItem)).Row)).ProductName;
e.VisualItem.Text = "<html> " + productName + "<br><span style=\"color:white\"> " + productName + "<br> " + categoryName + "</span>";
}
}
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