Example #1
0
        private void fillUpDataGridWithTvsItems(DataGridView dataReport, string nameTable)
        {
            dataReport.Rows.Clear();
            dataReport.Columns.Clear();

            var column1 = new DataGridViewColumn();

            column1.HeaderText   = "Название телевизора";
            column1.ReadOnly     = true;
            column1.Name         = "Name";
            column1.CellTemplate = new DataGridViewTextBoxCell();

            var column2 = new DataGridViewColumn();

            column2.HeaderText   = "Диагональ экрана";
            column2.Name         = "Screen_diagonal";
            column2.CellTemplate = new DataGridViewTextBoxCell();

            var column3 = new DataGridViewColumn();

            column3.HeaderText   = "Разрешение экрана";
            column3.Name         = "Max_resolution";
            column3.CellTemplate = new DataGridViewTextBoxCell();

            var column4 = new DataGridViewColumn();

            column4.HeaderText   = "Особенности";
            column4.Name         = "Features";
            column4.CellTemplate = new DataGridViewTextBoxCell();

            var column5 = new DataGridViewColumn();

            column5.HeaderText   = "Цена";
            column5.Name         = "Price";
            column5.CellTemplate = new DataGridViewTextBoxCell();

            var column6 = new DataGridViewColumn();

            column6.HeaderText   = "Кол-во";
            column6.Name         = "Quantity";
            column6.CellTemplate = new DataGridViewTextBoxCell();

            dataReport.Columns.Add(column1);
            dataReport.Columns.Add(column2);
            dataReport.Columns.Add(column3);
            dataReport.Columns.Add(column4);
            dataReport.Columns.Add(column5);
            dataReport.Columns.Add(column6);

            workServerStore.completeTvsReport(dataReport, nameTable);
        }