private void button1_Click(object sender, EventArgs e) { try { foreach (ListItem li2 in ch11.CheckedItems) { total_items[items] = li2.Text; items++; } foreach (ListItem li2 in ch1.CheckedItems) { total_items[items] = li2.Text; items++; } foreach (ListItem li2 in ch2.CheckedItems) { total_items[items] = li2.Text; items++; } foreach (ListItem li2 in ch3.CheckedItems) { total_items[items] = li2.Text; items++; } foreach (ListItem li2 in ch4.CheckedItems) { total_items[items] = li2.Text; items++; } foreach (ListItem li2 in ch5.CheckedItems) { total_items[items] = li2.Text; items++; } foreach (ListItem li2 in ch8.CheckedItems) { total_items[items] = li2.Text; items++; } foreach (ListItem li2 in ch6.CheckedItems) { total_items[items] = li2.Text; items++; } foreach (ListItem li2 in ch7.CheckedItems) { total_items[items] = li2.Text; items++; } foreach (ListItem li2 in ch9.CheckedItems) { total_items[items] = li2.Text; items++; } foreach (ListItem li2 in ch10.CheckedItems) { total_items[items] = li2.Text; items++; } dataGridView1.Rows.Clear(); dataGridView1.Columns.Clear(); dataGridView1.Columns.Add("Items", "Choosed Items"); try { for (int j = 0; j < items; j++) { dataGridView1.Rows.Add(total_items[j].ToString()); } } catch (Exception err) { MessageBox.Show(err.Message); } } catch (SqlException err) { MessageBox.Show(err.Message); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)