[]
This quick start guides you through the steps of creating a simple List application. You begin by creating a Windows Forms App in Visual Studio, adding he List control to the Form and binding it to a data source.
Follow the given steps to create a simple List application in .NET Edition.

Create a class named Product to be used as a data source.
public class Product
{
// Create a custom class Product
static Random _rnd = new Random();
static string[] _names = "Macko|Surfair|Pocohey|Studeby".Split('|');
static string[] _lines = "Computers|Washers|Stoves|Cars".Split('|');
static string[] _colors = "Red|Green|Blue|White".Split('|');
public Product()
{
Name = _names[_rnd.Next() % _names.Length];
Line = _lines[_rnd.Next() % _lines.Length];
Color = _colors[_rnd.Next() % _colors.Length];
Price = 30 + _rnd.NextDouble() * 1000;
Cost = 3 + _rnd.NextDouble() * 300;
Discontinued = _rnd.NextDouble() < .2;
Introduced = DateTime.Today.AddDays(_rnd.Next(-600, 0));
}
public string Name { get; set; }
public string Color { get; set; }
public string Line { get; set; }
public double Price { get; set; }
public double Cost { get; set; }
public DateTime Introduced { get; set; }
public bool Discontinued { get; set; }
}
Initialize a list of type Product.
// Initialises a List of type Product, where Product is a class type
List<Product> _products = new List<Product>();
Initialize a for loop to add products using the Add method as shown in the following code.
// Initialize for loop and add products to the list
for (int i = 0; i < 10; i++)
{
_products.Add(new Product());
}
Bind the List control to a data source by using DataSource property of the C1List class.
// Bind list with data
c1List1.DataSource = _products;
Add the following code to initialize and add the List control to the Form at runtime.
// Initialize the control
C1List c1list1 = new C1List();
// Add the control to form
this.Controls.Add(c1list1);
Follow the given steps to create a simple List application in .NET Framework.

There are two ways to bind data with the List control, either choose to bind at design time or through code at run time.
) to open the C1List Tasks smart tag panel in the design view.The above steps add a dataset, and a connection string to your project. With this, the following code gets generated automatically to fill the dataset:
// TODO: This line of code loads data into the 'c1NWindDataSet1.Products' table. You can move, or remove it, as needed.
this.productsTableAdapter.Fill(this.c1NWindDataSet1.Products);
To bind the List control through code, follow the given steps.
Create a method named GetConnectionString to return the connection string.
static string GetConnectionString()
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\ComponentOne Samples\Common";
string conn = @"provider=microsoft.jet.oledb.4.0;data source={0}\c1nwind.mdb;";
return string.Format(conn, path);
}
Subscribe to the Form_Load event and add the following code to the Form1_Load event handler. In this code, we create a string type object to fetch the connection string by calling the GetConnectionString() method and then populate the List control using DataSource property of the C1List class.
// bind list to a data source
string conn = GetConnectionString();
OleDbDataAdapter da = new OleDbDataAdapter("select * from products", conn);
DataTable dt = new DataTable("Products");
//fills the data table
da.Fill(dt);
//populate list control using DataSource property
c1List1.DataSource = dt;
Add the following code to initialize and add the List control to the Form at runtime.
// Initialize the control
C1List c1list1 = new C1List();
// Add the control to form
this.Controls.Add(c1list1);