Using a ListView Control in a Windows Forms Application
Adding a column to a ListView
listView2.Columns.Add("Here your column name", here width with integer value);![]()

You can simply add a column to a ListView by these steps
select ListView control and right click>properties>columns
Now we are going to bind our ListView Control
We have 6 columns to bind, binding using a ListView sub item.
public void listViewFill()
{
try
{
SqlConnection con= new SqlConnection("data source=.\\sqlexpress;database=main;integrated
security=true;" );
listView2.Items.Clear();
SqlDataAdapter adp = new SqlDataAdapter("SELECT P_NAME, P_PACKING, F_ORMFD, F_MRP, F_STRATE FROM PMS", con);
DataTable dt = new DataTable();
adp.Fill(dt);
for (int i = 0; i < dt.Rows.Count; i++)
{
DataRow dr = dt.Rows[i];
ListViewItem listitem = new ListViewItem(dr[0].ToString());
listitem.SubItems.Add("| " + dr[1].ToString().PadLeft(3));
listitem.SubItems.Add("| " + dr[2].ToString());
listitem.SubItems.Add("| " + dr[3].ToString());
listitem.SubItems.Add("| " + dr[4].ToString());
listitem.SubItems.Add("| " + dr[5].ToString());
listView2.Items.Add(listitem);
}
}
catch (Exception ms) { }}

Font and color>>>>
listView2.BackColor = System.Drawing.Color.PowderBlue;





Abhilash Raj R SPosted Nov 14, 2016, 9:14 AM
I tried my own database its not working
Narasimha Rao KarivedaPosted Apr 28, 2014, 10:49 PM
can we apply paging to ListView in vb.net 2005 win forms