Simple Listview Example

Rajesh_Kumar
Posted by Rajesh_Kumar under C# category on | Points: 40 | Views : 768
listView1.Items.Add("C#");
listView1.Items.Add("VB.Net");
listView1.Items.Add("ASP.NET");
listView1.Items.Add("Ajax");
listView1.Items.Add("Sql-Server");

listView1.View = View.Details;

//add checkboxes
listView1.CheckBoxes = true;

ListViewItem item1 = new ListViewItem("item1", 0);

item1.Checked = true;
item1.SubItems.Add("OOPS");
item1.SubItems.Add("Reflection");
item1.SubItems.Add("Polymorphism");

// Create columns for the items and subitems.
listView1.Columns.Add("Column 2", -2, HorizontalAlignment.Left);
listView1.Columns.Add("Column 2", -2, HorizontalAlignment.Left);

listView1.Sorting = SortOrder.Ascending;

Comments or Responses

Login to post response