Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string[]            arr      = { "VIN", "Farve", "Mærke", "Model", "Årgang", "UniqueID", "City" };
            List <ListViewItem> itemsArr = new List <ListViewItem>();
            ShowCars            sc       = new ShowCars();
            showWindow          sw       = new showWindow(arr, sc.ReturnList());

            sw.Clear();
            sw.Bounds             = new Rectangle(new Point(10, 10), new Size(800, 500));
            sw.View               = View.Details;
            sw.LabelEdit          = true;
            sw.AllowColumnReorder = true;
            sw.FullRowSelect      = true;
            sw.GridLines          = true;
            sw.Sorting            = SortOrder.Ascending;
            sw.Columns.Add("*", 4, HorizontalAlignment.Left);
            foreach (string column in arr)
            {
                sw.Columns.Add(column.ToString(), 100, HorizontalAlignment.Left);
            }
            foreach (ListViewItem item in sc.ReturnList())
            {
                sw.Items.Add(item);
            }
            this.Controls.Add(sw);
        }
Beispiel #2
0
        private void GetClients()
        {
            string[]            arr      = { "Adresse", "KundeID", "Navn", "Efternavn", "City", "Telefon" };
            List <ListViewItem> itemsArr = new List <ListViewItem>();
            showClients         sc       = new showClients();
            showWindow          sw       = new showWindow(arr, sc.ReturnList());

            sw.Clear();
            sw.Bounds             = new Rectangle(new Point(10, 10), new Size(800, 500));
            sw.View               = View.Details;
            sw.LabelEdit          = true;
            sw.AllowColumnReorder = true;
            sw.FullRowSelect      = true;
            sw.GridLines          = true;
            sw.Sorting            = SortOrder.Ascending;
            sw.Columns.Add("*", 4, HorizontalAlignment.Left);
            foreach (string column in arr)
            {
                sw.Columns.Add(column.ToString(), 100, HorizontalAlignment.Left);
            }
            foreach (ListViewItem item in sc.ReturnList())
            {
                sw.Items.Add(item);
            }
            this.Controls.Add(sw);
        }