Hi everyone,
Im trying to create listview with two headers.
Main header is regular one.
But line bellow should be another header but with two cells.
In "2nd" header there should be only text.
And in all other rows there should be checkboxes.
Here is the picture how it should look like.
What i have in this moment is:
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- listView1.Columns.Clear();
- SqlConnection con = new SqlConnection(@"Data Source=MAIN-PC\SQLEXPRESS;Integrated Security=True");
- SqlCommand cmd = new SqlCommand("USE "+comboBox1.Text+" ; Select * FROM stores",con);
- DataTable dt = new DataTable();
- con.Open();
- SqlDataAdapter da = new SqlDataAdapter(cmd);
- da.Fill(dt);
- ListView view = new ListView();
- view.View = View.Details;
-
- listView1.Columns.Add("Store", 120, HorizontalAlignment.Left);
- foreach(DataRow row in dt.Rows)
- {
- listView1.Columns.Add(row[0].ToString()+" "+ ""+row[1].ToString()+"" , 80, HorizontalAlignment.Left);
- }
- listView1.Items.Clear();
-
- listView1.Items.Add("Status");
- foreach (DataRow row in dt.Rows)
- {
- }
Thank you.