Esempio n. 1
0
 private void LoadAccounts()
 {
     accountGrid.Columns.Clear();
     accountGrid.AutoGenerateColumns = false;
     accountGrid.DataSource = null;
     DataGridViewColumn realm = new DataGridViewTextBoxColumn();
     realm.DataPropertyName = "Realm";
     realm.Name = "Realm";
     realm.HeaderText = "Realm";
     accountGrid.Columns.Add(realm);
     DataGridViewColumn Faction = new DataGridViewTextBoxColumn();
     Faction.DataPropertyName = "Faction";
     Faction.Name = "Faction";
     Faction.HeaderText = "Faction";
     accountGrid.Columns.Add(Faction);
     DataGridViewColumn CharName = new DataGridViewTextBoxColumn();
     CharName.DataPropertyName = "Name";
     CharName.Name = "Name";
     CharName.HeaderText = "Name";
     accountGrid.Columns.Add(CharName);
     DataGridViewColumn gold = new DataGridViewTextBoxColumn();
     gold.DataPropertyName = "Gold";
     gold.Name = "Gold";
     gold.HeaderText = "Gold";
     accountGrid.Columns.Add(gold);
 }
        private void AddColumns()
        {
            columnSourceFolder = new DataGridViewTextBoxColumn();
            columnSourceFolder.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            columnSourceFolder.HeaderText = "Original Folder";
            columnSourceFolder.Name = "columnSourceFolder";
            columnSourceFolder.ReadOnly = true;
            dataGridViewWorkSpace.Columns.Add(columnSourceFolder);

            // Add target folder column
            columnTargetFolder = new DataGridViewDontDrawRightBorderColumn();
            columnTargetFolder.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            columnTargetFolder.HeaderText = "Branched Folder";
            columnTargetFolder.Name = "columnTargetFolder";
            dataGridViewWorkSpace.Columns.Add(columnTargetFolder);

            // Add the custom button column
            columnSourceControlPicker = new DataGridViewInvisibleButtonColumn();
            columnSourceControlPicker.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
            columnSourceControlPicker.HeaderText = "";
            columnSourceControlPicker.Name = "columnSourceControlPicker";
            columnSourceControlPicker.ReadOnly = true;
            columnSourceControlPicker.Resizable = System.Windows.Forms.DataGridViewTriState.False;
            columnSourceControlPicker.Text = "...";
            columnSourceControlPicker.UseColumnTextForButtonValue = true;
            columnSourceControlPicker.Width = 5;
            columnSourceControlPicker.DefaultCellStyle.SelectionBackColor = columnSourceControlPicker.DefaultCellStyle.BackColor;
            columnSourceControlPicker.DefaultCellStyle.SelectionForeColor = columnSourceControlPicker.DefaultCellStyle.ForeColor;
            dataGridViewWorkSpace.Columns.Add(columnSourceControlPicker);
        }
Esempio n. 3
0
        public TimelineView(TimelineController controller_)
        {
            controller = controller_;
            controller.TimelineUpdate += controller_TimelineUpdate;
            controller.CurrentTimeUpdate += controller_CurrentTimeUpdate;

            textWidth = 100;
            barWidth = 100;

            SetupUI();

            this.MouseDown += TimelineView_MouseDown;
            this.VisibleChanged += TimelineView_VisibleChanged;
            this.Move += TimelineView_Move;
            this.FormClosing += TimelineView_FormClosing;

            typeof(DataGridView).
                GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).
                SetValue(dataGridView, true, null);
            dataGridView.SelectionChanged += (object sender, EventArgs args) => dataGridView.ClearSelection();
            dataGridView.AutoGenerateColumns = false;
            dataGridView.Columns.Add(textColumn = new DataGridViewTextBoxColumn { DataPropertyName = "Name", AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill });
            dataGridView.Columns.Add(timeLeftColumn = new TimeLeftColumn { Controller = controller_ });

            MyOpacity = 0.8;
            NumberOfRowsToDisplay = 3;
            MoveByDrag = true;
            ShowOverlayButtons = true;
            UpdateLayout();

            soundplayer = new CachedSoundPlayer();

            TimelineFont = new Font(FontFamily.GenericSansSerif, 12, FontStyle.Bold);
        }
Esempio n. 4
0
        protected void ConfigurarColunasPrincipais()
        {
            DataGridViewTextBoxColumn IDAmbiente = new DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn Cor = new DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn Descricao = new DataGridViewTextBoxColumn();

            IDAmbiente.DataPropertyName = "IDAmbiente";
            IDAmbiente.HeaderText = "ID";
            IDAmbiente.Name = "IDAmbiente";
            IDAmbiente.ReadOnly = true;
            IDAmbiente.Width = 49;

            Cor.DataPropertyName = "Cor";
            Cor.HeaderText = "Cor";
            Cor.Name = "Cor";
            Cor.ReadOnly = true;
            Cor.Width = 77;

            Descricao.DataPropertyName = "Descricao";
            Descricao.HeaderText = "Descrição";
            Descricao.Name = "Descricao";
            Descricao.ReadOnly = true;
            Descricao.Width = 77;
            Descricao.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

            colunasAdicionadas = true;
            dtgDados.Columns.AddRange(new DataGridViewColumn[] {
                IDAmbiente, Cor, Descricao
            });
        }
Esempio n. 5
0
 public ItemsGridView()
 {
     //
     //
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
     this.AutoGenerateColumns = false;
     Items_id                    = new DataGridViewTextBoxColumn();
     Items_name                  = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Items_receipt_id            = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Items_price                 = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Items_isReturn              = new System.Windows.Forms.DataGridViewCheckBoxColumn();
     Items_tag_printed           = new System.Windows.Forms.DataGridViewCheckBoxColumn();
     Items_receipt_date          = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Items_volume                = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Items_boxid                 = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Items_comment               = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Items_sell_price            = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Items_sell_date             = new System.Windows.Forms.DataGridViewTextBoxColumn();
     dataGridViewCellStyle1.Font = new System.Drawing.Font("Meiryo UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
     this.CellBeginEdit         += new DataGridViewCellCancelEventHandler(ItemsGridView_CellBeginEdit);
     this.CellEndEdit           += new DataGridViewCellEventHandler(ItemsGridView_CellEndEdit);
     this.RowLeave              += new DataGridViewCellEventHandler(ItemsGridView_RowLeave);
     this.RowEnter              += new DataGridViewCellEventHandler(ItemsGridView_RowEnter);
     this.Leave                 += new EventHandler(ItemsGridView_Leave);
     this.UserDeletingRow       += new DataGridViewRowCancelEventHandler(ItemsGridView_UserDeletingRow);
     this.UserDeletedRow        += new DataGridViewRowEventHandler(ItemsGridView_UserDeletedRow);
 }
Esempio n. 6
0
        public statsGrid(string title)
        {
            gridControl = new System.Windows.Forms.DataGridView();
            CharNo      = new System.Windows.Forms.DataGridViewTextBoxColumn();
            Nominal     = new System.Windows.Forms.DataGridViewTextBoxColumn();
            Mean        = new System.Windows.Forms.DataGridViewTextBoxColumn();
            Variance    = new System.Windows.Forms.DataGridViewTextBoxColumn();
            StdDev      = new System.Windows.Forms.DataGridViewTextBoxColumn();
            tabPage     = null;

            //
            // dataGridView1
            //
            gridControl.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
                CharNo, Nominal, Mean, Variance, StdDev
            });
            gridControl.Location = new System.Drawing.Point(0, 0);
            gridControl.Name     = "dataGridView2";
            gridControl.Size     = new System.Drawing.Size(643, 567);
            //gridControl.Size = new System.Drawing.Size(600, 500);
            //gridControl.Width = 450;
            //gridControl.Height = 450;
            gridControl.TabIndex   = 13;
            gridControl.ScrollBars = ScrollBars.Both;
            //gridControl.AutoSize = true;
            //
            // CharNo
            //
            //CharNo.Frozen = true;
            CharNo.HeaderText = "CharNo";
            CharNo.Name       = "CharNo";
            CharNo.ReadOnly   = true;
            CharNo.Width      = 70;
            //
            // Nominal
            //
            //Nominal.Frozen = true;
            Nominal.HeaderText = "Nominal";
            Nominal.Name       = "Nominal";
            Nominal.ReadOnly   = true;
            Nominal.Width      = 120;
            //
            // Mean
            //
            Mean.HeaderText = "Mean";
            Mean.Name       = "Mean";
            Mean.Width      = 70;
            //
            // Variance
            //
            Variance.HeaderText = "Variance";
            Variance.Name       = "Variance";
            Variance.Width      = 70;
            //
            // StdDeviation
            //
            StdDev.HeaderText = "StdDev";
            StdDev.Name       = "StdDev";
            StdDev.Width      = 70;
        }
 private void dgvDataFormat()
 {
     dgvData.Columns["ChkID"].Visible = false;
     DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn();
     col.Name = "自主檢查";
     col.HeaderText = "自主檢查";
     dgvData.Columns.Add(col);
     dgvData.Columns["自主檢查"].DisplayIndex = 6;
     for(int i = 0; i < dgvData.Rows.Count - 1; i++)
     {
         if (Convert.ToInt32(dgvData.Rows[i].Cells["ChkID"].Value) == 0)
         {
             dgvData.Rows[i].Cells["自主檢查"].Value = "首件";
         }
         else
         {
             dgvData.Rows[i].Cells["自主檢查"].Value = "製程中";
         }
     }
     dgvData.Columns["日期"].Width = 145;
     dgvData.Columns["料號"].Width = 100;
     dgvData.Columns["版序"].Width = 60;
     dgvData.Columns["批號"].Width = 100;
     dgvData.Columns["層別"].Width = 60;
     dgvData.Columns["數量"].Width = 60;
     dgvData.Columns["檢驗數量"].Width = 90;
     dgvData.Columns["氧化/水痕"].Width = 90;
     dgvData.Columns["刮傷"].Width = 60;
     dgvData.Columns["膜皺"].Width = 60;
     dgvData.Columns["膜偏留邊"].Width = 90;
     dgvData.Columns["板面氣泡"].Width = 90;
     dgvData.Columns["判定"].Width = 60;
     dgvData.Columns["檢驗人員"].Width = 90;
     dgvData.Columns["備註"].Width = 150;
 }
Esempio n. 8
0
        private void BindearDetalle()
        {
            // Initialize the DataGridView.
            bsCotizacionDetalle.DataSource = new List<CotizacionDetalle>();
            dgvCotizacion.AutoGenerateColumns = false;
            dgvCotizacion.AllowUserToAddRows = false;
            dgvCotizacion.AutoSize = true;
            dgvCotizacion.DataSource = bsCotizacionDetalle;

            // Initialize and add a text box column.
            DataGridViewColumn column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Renglon";
            column.Name = "Renglon";
            column.ReadOnly = true;
            dgvCotizacion.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "CveArt";
            column.Name = "Articulo";
            column.ReadOnly = true;
            dgvCotizacion.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "DescripcionArt";
            column.Width = 150;
            column.Name = "Descripcion";
            column.ReadOnly = true;
            dgvCotizacion.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "PresentacionArt";
            column.Name = "Presentacion";
            column.ReadOnly = true;
            dgvCotizacion.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Cantidad";
            column.Name = "Cantidad";
            column.ReadOnly = true;
            dgvCotizacion.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Precio";
            column.Name = "Precio Unitario";
            column.Width = 75;
            column.ReadOnly = false;
            dgvCotizacion.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Marca";
            column.Name = "Marca";
            column.ReadOnly = false;
            dgvCotizacion.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Observaciones";
            column.Name = "Observaciones";
            column.ReadOnly = false;
            dgvCotizacion.Columns.Add(column);
        }
Esempio n. 9
0
        public void AddCols()
        {
            DgWorkers.AutoGenerateColumns = false;
            var col1 = new DataGridViewTextBoxColumn();
            var col2 = new DataGridViewTextBoxColumn();
            var col3 = new DataGridViewTextBoxColumn();
            var col4 = new DataGridViewCheckBoxColumn();

            col1.HeaderText = "מספר עובד";
            col1.DataPropertyName = "ID";
            col1.Name = "WorkerNumber";
            DgWorkers.Columns.Add(col1);

            col2.HeaderText = "שם פרטי";
            col2.DataPropertyName = "FirstName";
            col2.Name = "FirstName";
            DgWorkers.Columns.Add(col2);

            col3.HeaderText = "שם משפחה";
            col3.DataPropertyName = "LastName";
            col3.Name = "LastName";
            DgWorkers.Columns.Add(col3);

            col4.HeaderText = "פעיל";
            col4.DataPropertyName = "Active";
            col4.Name = "Active";
            DgWorkers.Columns.Add(col4);
        }
Esempio n. 10
0
        private static void SetDataGrid(DataGridView grid, DataTable tbl)
        {
            grid.DataSource = tbl;

            DataGridViewCellStyle amountCellStyle = new System.Windows.Forms.DataGridViewCellStyle();

            amountCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
            amountCellStyle.Format    = "N" + Settings.sysPrecisionLocal.ToString();
            amountCellStyle.NullValue = null;

            grid.Columns.Clear();
            for (int idx = 0; idx < tbl.Columns.Count; idx++)
            {
                DataGridViewTextBoxColumn column = new System.Windows.Forms.DataGridViewTextBoxColumn();
                grid.Columns.Add(column);
                column.DataPropertyName = tbl.Columns[idx].ColumnName;
                if (idx == 0)
                {
                    column.HeaderText = "Mã.CK";
                    column.Width      = 60;
                    column.Frozen     = true;
                }
                else
                {
                    column.HeaderText       = tbl.Columns[idx].ColumnName;
                    column.Width            = 90;
                    column.DefaultCellStyle = amountCellStyle;
                }
                column.Name = idx.ToString();
            }
            AdjustTestGridSize(grid);
        }
Esempio n. 11
0
        private void fillTrainingBags()
        {
            DataGridViewColumn dgvIndex = new DataGridViewTextBoxColumn();
            {
                dgvIndex.HeaderText = "Slot";
                dgvIndex.DisplayIndex = 0;
                dgvIndex.Width = 25;
                dgvIndex.ReadOnly = true;
                dgvIndex.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            }
            DataGridViewComboBoxColumn dgvBag = new DataGridViewComboBoxColumn
            {
                DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing
            };
            {
                foreach (string t in trba)
                    if (t.Length > 0)
                        dgvBag.Items.Add(t);

                dgvBag.DisplayIndex = 1;
                dgvBag.Width = 135;
                dgvBag.FlatStyle = FlatStyle.Flat;
            }
            dataGridView1.Columns.Add(dgvIndex);
            dataGridView1.Columns.Add(dgvBag);

            dataGridView1.Rows.Add(12);
            int offset = Main.SAV.SuperTrain + 0x308;
            for (int i = 0; i < 12; i++)
            {
                dataGridView1.Rows[i].Cells[0].Value = (i + 1).ToString();
                dataGridView1.Rows[i].Cells[1].Value = trba[sav[offset + i]];
            }
        }        
Esempio n. 12
0
        protected void ConfigurarColunasPrincipais()
        {
            DataGridViewTextBoxColumn IDEmail = new DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn Assunto = new DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn Corpo = new DataGridViewTextBoxColumn();

            IDEmail.DataPropertyName = "IDEmail";
            IDEmail.HeaderText = "Código";
            IDEmail.Name = "IDEmail";
            IDEmail.ReadOnly = true;
            IDEmail.Width = 50;

            Assunto.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
            Assunto.DataPropertyName = "Assunto";
            Assunto.HeaderText = "Assunto";
            Assunto.Name = "Assunto";
            Assunto.ReadOnly = true;

            Corpo.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
            Corpo.DataPropertyName = "CorpoMensagem";
            Corpo.HeaderText = "Corpo do E-Mail";
            Corpo.Name = "CorpoMensagem";
            Corpo.ReadOnly = true;

            colunasAdicionadas = true;
            dtgDados.Columns.AddRange(new DataGridViewColumn[] { IDEmail, Assunto, Corpo });
        }
        private void InitializeParameterGrid()
        {
            MethodParametersGrid.AutoGenerateColumns = false;
            MethodParametersGrid.Columns.Clear();
            MethodParametersGrid.DataSource = _parameters;
            MethodParametersGrid.AlternatingRowsDefaultCellStyle.BackColor = Color.Lavender;
            MethodParametersGrid.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            var paramNameColumn = new DataGridViewTextBoxColumn
            {
                Name = "Name",
                DataPropertyName = "Name",
                HeaderText = RubberduckUI.Name,
                ReadOnly = true
            };

            var paramTypeColumn = new DataGridViewTextBoxColumn
            {
                Name = "TypeName",
                DataPropertyName = "TypeName",
                HeaderText = RubberduckUI.Type,
                ReadOnly = true
            };

            var paramPassedByColumn = new DataGridViewTextBoxColumn
            {
                Name = "Passed",
                AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill,
                HeaderText = RubberduckUI.Passed,
                DataPropertyName = "Passed",
                ReadOnly = true
            };

            MethodParametersGrid.Columns.AddRange(paramNameColumn, paramTypeColumn, paramPassedByColumn);
        }
 private void initPartnerKolone()
 {
     DataGridViewColumn col = new DataGridViewTextBoxColumn();
     col.Name = "colJIB";
     col.HeaderText = "JIB";
     col.ToolTipText = "Jedinstveni indentifikacioni broj partnera";
     col.FillWeight = 50;
     dgPregled.Columns.Add(col);
     col = new DataGridViewTextBoxColumn();
     col.Name = "colNaziv";
     col.HeaderText = "Naziv partnera";
     col.ToolTipText = "Naziv partnera";
     col.FillWeight = 150;
     dgPregled.Columns.Add(col);
     col = new DataGridViewTextBoxColumn();
     col.Name = "colAdresa";
     col.HeaderText = "Adresa partnera";
     col.FillWeight = 100;
     dgPregled.Columns.Add(col);
     col = new DataGridViewTextBoxColumn();
     col.Name = "colMjesto";
     col.HeaderText = "Mjesto";
     col.FillWeight = 80;
     dgPregled.Columns.Add(col);
     col = new DataGridViewButtonColumn();
     col.Name = "colIzmjeni";
     col.HeaderText = "Izmjeni";
     dgPregled.Columns.Add(col);
     dgPregled.CellContentClick += new DataGridViewCellEventHandler(cellContentClick);
 }
Esempio n. 15
0
 private void btnColumnAdd_Click(object sender, EventArgs e)
 {
     DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn();
     col.SortMode = DataGridViewColumnSortMode.NotSortable;
     col.HeaderText = string.Empty;
     dgvData.Columns.Add(col);
 }
        private void SetupComponent()
        {
            this.AllowUserToResizeColumns    = true;
            this.ColumnHeadersVisible        = true;
            this.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;

            for (int i = _History.Count - 1; i >= 0; i--)
            {
                System.Windows.Forms.DataGridViewTextBoxColumn statDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
                statDataGridViewTextBoxColumn.HeaderText = "Trial " + (i + 1);
                statDataGridViewTextBoxColumn.Name       = "statDataGridViewTextBoxColumn" + i;
                statDataGridViewTextBoxColumn.ReadOnly   = true;
                statDataGridViewTextBoxColumn.Width      = 70;
                if (!this.Columns.Contains(statDataGridViewTextBoxColumn.Name))
                {
                    this.Columns.Add(statDataGridViewTextBoxColumn);
                }
            }
            if (_History.Count > 1)
            {
                System.Windows.Forms.DataGridViewTextBoxColumn avgDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
                avgDataGridViewTextBoxColumn.HeaderText = "Average";
                avgDataGridViewTextBoxColumn.Name       = "avgDataGridViewTextBoxColumn";
                avgDataGridViewTextBoxColumn.ReadOnly   = true;
                avgDataGridViewTextBoxColumn.Width      = 80;
                if (!this.Columns.Contains(avgDataGridViewTextBoxColumn.Name))
                {
                    this.Columns.Add(avgDataGridViewTextBoxColumn);
                }
            }
        }
        /// <summary>
        /// 只有在程序运行时才能显示出来的界面更新效果
        /// </summary>
        private void InitializeComponent_ActivateAtRuntime()
        {
            System.Windows.Forms.DataGridViewTextBoxColumn  PointName       = default(System.Windows.Forms.DataGridViewTextBoxColumn);
            System.Windows.Forms.DataGridViewTextBoxColumn  DataOffset      = default(System.Windows.Forms.DataGridViewTextBoxColumn);
            System.Windows.Forms.DataGridViewComboBoxColumn SearchDirection = default(System.Windows.Forms.DataGridViewComboBoxColumn);


            PointName       = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataOffset      = new System.Windows.Forms.DataGridViewTextBoxColumn();
            SearchDirection = new System.Windows.Forms.DataGridViewComboBoxColumn();

            //PointName
            //
            PointName.HeaderText  = "点位特征名";
            PointName.Name        = "PointName";
            PointName.SortMode    = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            PointName.ToolTipText = "特征名是包含于实际的监测点位的,比如:特征名CX会在Word文档中搜索包含有CX的所有测点,如TCX01。";
            //


            //SearchDirection
            //
            SearchDirection.HeaderText = "搜索";
            SearchDirection.Items.AddRange(new object[] { "按行", "按列" });
            SearchDirection.Name = "SearchDirection";
            //

            //DataOffset
            //
            System.Windows.Forms.DataGridViewCellStyle DataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
            DataGridViewCellStyle2.ForeColor = System.Drawing.Color.Blue;
            DataOffset.DefaultCellStyle      = DataGridViewCellStyle2;
            DataOffset.HeaderText            = "数据偏移";
            DataOffset.Name        = "DataOffset";
            DataOffset.SortMode    = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            DataOffset.ToolTipText = "如果点位的数据在点位单元格的右侧且与之相邻,则为1";
            DataOffset.Width       = 80;


            //MyDataGridView1
            //
            System.Windows.Forms.DataGridViewCellStyle DataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
            DataGridViewCellStyle1.Alignment                   = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            DataGridViewCellStyle1.BackColor                   = System.Drawing.SystemColors.Control;
            DataGridViewCellStyle1.Font                        = new System.Drawing.Font("SimSun", (float)(9.0F), System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, System.Convert.ToByte(134));
            DataGridViewCellStyle1.ForeColor                   = System.Drawing.SystemColors.WindowText;
            DataGridViewCellStyle1.SelectionBackColor          = System.Drawing.SystemColors.Highlight;
            DataGridViewCellStyle1.SelectionForeColor          = System.Drawing.SystemColors.HighlightText;
            DataGridViewCellStyle1.WrapMode                    = System.Windows.Forms.DataGridViewTriState.True;
            this.MyDataGridView1.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1;
            this.MyDataGridView1.ColumnHeadersHeight           = 25;
            this.MyDataGridView1.ColumnHeadersHeightSizeMode   = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
            this.MyDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { PointName, DataOffset, SearchDirection });
            this.MyDataGridView1.Location              = new System.Drawing.Point(11, 181);
            this.MyDataGridView1.RowTemplate.Height    = 23;
            this.MyDataGridView1.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False;
            this.MyDataGridView1.ScrollBars            = System.Windows.Forms.ScrollBars.Vertical;
            this.MyDataGridView1.Size     = new System.Drawing.Size(346, 110);
            this.MyDataGridView1.TabIndex = 14;
        }
        private void generarGrilla()
        {
            DataGridViewTextBoxColumn ColDia = new DataGridViewTextBoxColumn();
            ColDia.DataPropertyName = "StringDia";
            ColDia.HeaderText = "Día";
            ColDia.Width = 120;
            grillaAgenda.Columns.Add(ColDia);

            DataGridViewTextBoxColumn ColHoraDesde = new DataGridViewTextBoxColumn();
            ColHoraDesde.DataPropertyName = "HoraDesde";
            ColHoraDesde.HeaderText = "Hora Desde";
            ColHoraDesde.Width = 120;
            grillaAgenda.Columns.Add(ColHoraDesde);

            DataGridViewTextBoxColumn ColHoraHasta = new DataGridViewTextBoxColumn();
            ColHoraHasta.DataPropertyName = "HoraHasta";
            ColHoraHasta.HeaderText = "Hora Hasta";
            ColHoraHasta.Width = 120;
            grillaAgenda.Columns.Add(ColHoraHasta);

            DataGridViewTextBoxColumn ColEspecialidad = new DataGridViewTextBoxColumn();
            ColEspecialidad.DataPropertyName = "EspString";
            ColEspecialidad.HeaderText = "Especialidad";
            ColEspecialidad.Width = 120;
            grillaAgenda.Columns.Add(ColEspecialidad);
        }
Esempio n. 19
0
 private void SetKol(ref System.Windows.Forms.DataGridViewTextBoxColumn kol, int teller)
 {
     if (teller % nRot == 0)
     {
         kol.DividerWidth = 1;
     }
 }
        private void InitGrid()
        {
            var clPlanId = new DataGridViewTextBoxColumn { HeaderText = "Id", DataPropertyName = "Id", Name = "Id" };
            clPlanId.Visible = false;
            grd.Columns.Add(clPlanId);

            var clClinicId = new DataGridViewTextBoxColumn { HeaderText = "Mã phòng khám", DataPropertyName = "ClinicId", Name = "ClinicId" };
            clClinicId.Visible = false;
            grd.Columns.Add(clClinicId);

            var clClinicName = new DataGridViewTextBoxColumn { HeaderText = "Phòng khám", DataPropertyName = "ClinicName", Name = "ClinicName" };
            clClinicName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            clClinicName.ReadOnly = true;
            grd.Columns.Add(clClinicName);

            var clMedicineName = new DataGridViewTextBoxColumn { HeaderText = "Năm", DataPropertyName = "Year", Name = "Year" };
            clMedicineName.ReadOnly = true;
            grd.Columns.Add(clMedicineName);

            var clInStock = new DataGridViewTextBoxColumn { HeaderText = "Tháng", DataPropertyName = "Month", Name = "Month" };
            clInStock.ReadOnly = true;
            grd.Columns.Add(clInStock);

            var clLastMonthUsage = new DataGridViewTextBoxColumn { HeaderText = "Trạng thái", DataPropertyName = "Status", Name = "Status" };
            clLastMonthUsage.ReadOnly = true;
            grd.Columns.Add(clLastMonthUsage);

            var clCurrentMonthUsage = new DataGridViewTextBoxColumn { HeaderText = "Chú ý", DataPropertyName = "Note", Name = "Note" };
            clCurrentMonthUsage.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            clCurrentMonthUsage.ReadOnly = true;
            grd.Columns.Add(clCurrentMonthUsage);
        }
        private void InitTodoMarkersGridView(IList<ToDoMarker> markers)
        {
            TodoMarkersGridView.AutoGenerateColumns = false;
            TodoMarkersGridView.Columns.Clear();
            TodoMarkersGridView.DataSource = new BindingList<ToDoMarker>(markers);
            TodoMarkersGridView.AlternatingRowsDefaultCellStyle.BackColor = Color.Lavender;
            TodoMarkersGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            TodoMarkersGridView.CellValueChanged += SelectedPriorityChanged;
            TodoMarkersGridView.ColumnHeaderMouseClick += SortColumn;

            var markerTextColumn = new DataGridViewTextBoxColumn
            {
                Name = "Text",
                DataPropertyName = "Text",
                HeaderText = RubberduckUI.TodoSettings_Text,
                ReadOnly = true
            };

            var markerPriorityColumn = new DataGridViewComboBoxColumn
            {
                Name = "Priority",
                DataSource = TodoLabels(),
                AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill,
                HeaderText = RubberduckUI.TodoSettings_Priority,
                DataPropertyName = "PriorityLabel",
            };

            TodoMarkersGridView.Columns.AddRange(markerTextColumn, markerPriorityColumn);
        }
Esempio n. 22
0
        private static void SetDataGrid(common.controls.baseDataGridView grid, DataTable tbl)
        {
            grid.DataSource = tbl;

            DataGridViewCellStyle amountCellStyle = new System.Windows.Forms.DataGridViewCellStyle();

            amountCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
            amountCellStyle.Format    = "N" + common.system.GetPrecisionFromMask(Settings.sysMaskLocalAmt);
            amountCellStyle.NullValue = null;

            grid.Columns.Clear();
            for (int idx = 0; idx < tbl.Columns.Count; idx++)
            {
                DataGridViewTextBoxColumn column = new System.Windows.Forms.DataGridViewTextBoxColumn();
                grid.Columns.Add(column);
                column.DataPropertyName = tbl.Columns[idx].ColumnName;
                if (idx == 0)
                {
                    column.HeaderText = "Strategy";
                    column.Width      = 100;
                    column.Frozen     = true;
                }
                else
                {
                    column.HeaderText       = tbl.Columns[idx].Caption;
                    column.Width            = 90;
                    column.DefaultCellStyle = amountCellStyle;
                }
                column.Name = idx.ToString();
            }
            grid.AllowUserToAddRows    = false;
            grid.AllowUserToDeleteRows = false;
            AdjustTestGridSize(grid);
        }
Esempio n. 23
0
 public static void createColumnDataGridView(DataGridView dgvAgenda)
 {
     dgvAgenda.AutoGenerateColumns = false;
     DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn();
     col.DataPropertyName = "ag";
     col.HeaderText = "object";
     col.Width = 50;
     col.Visible = false;
     dgvAgenda.Columns.Add(col);
     col = new DataGridViewTextBoxColumn();
     col.DataPropertyName = "hour";
     col.HeaderText = "Heure";
     col.Width = 50;
     dgvAgenda.Columns.Add(col);
     col = new DataGridViewTextBoxColumn();
     col.DataPropertyName = "Nom";
     col.HeaderText = "Client";
     col.Width = 140;
     dgvAgenda.Columns.Add(col);
     col = new DataGridViewTextBoxColumn();
     col.DataPropertyName = "animal";
     col.HeaderText = "Animal";
     col.Width = 140;
     dgvAgenda.Columns.Add(col);
     col = new DataGridViewTextBoxColumn();
     col.DataPropertyName = "race";
     col.HeaderText = "Race";
     col.Width = 80;
     dgvAgenda.Columns.Add(col);
 }
Esempio n. 24
0
        private void BuildDataGridViewStructure()
        {
            dgvList.AllowUserToAddRows = false;
            dgvList.MultiSelect = false;
            dgvList.AllowUserToResizeRows = false;
            dgvList.ReadOnly = true;
            dgvList.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            dgvList.AutoGenerateColumns = false;

            DataGridViewTextBoxColumn id = new DataGridViewTextBoxColumn();
            id.DisplayIndex = 0;
            id.Name = "Id";
            id.ReadOnly = true;
            id.HeaderText = "Id";
            id.DataPropertyName = "Id";

            DataGridViewTextBoxColumn name = new DataGridViewTextBoxColumn();
            name.DisplayIndex = 1;
            name.Name = "Name";
            name.ReadOnly = true;
            name.HeaderText = "Name";
            name.DataPropertyName = "Name";

            DataGridViewCheckBoxColumn enabled = new DataGridViewCheckBoxColumn();
            enabled.DisplayIndex = 2;
            enabled.Name = "Enabled";
            enabled.ReadOnly = true;
            enabled.HeaderText = "Enabled";
            enabled.DataPropertyName = "Enabled";

            dgvList.Columns.AddRange(id, name, enabled);
        }
Esempio n. 25
0
        /// <summary>
        /// Set the contend of the Grid with DataTable value
        /// </summary>
        /// <param name="grid"></param>
        /// <param name="tbl"></param>
        private void SetDataGrid(DataGridView grid, DataTable tbl)
        {
            grid.DataSource = tbl;

            DataGridViewCellStyle amountCellStyle = new System.Windows.Forms.DataGridViewCellStyle();

            amountCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
            amountCellStyle.Format    = "N" + common.system.GetPrecisionFromMask(Settings.sysMaskLocalAmt);
            amountCellStyle.NullValue = null;

            application.Strategy.Meta meta;
            grid.Columns.Clear();
            for (int idx = 0; idx < tbl.Columns.Count; idx++)
            {
                DataGridViewTextBoxColumn column = new System.Windows.Forms.DataGridViewTextBoxColumn();
                grid.Columns.Add(column);
                column.DataPropertyName = tbl.Columns[idx].ColumnName;
                if (idx == 0)
                {
                    column.Width  = 70;
                    column.Frozen = true;
                }
                else
                {
                    meta = application.Strategy.Libs.FindMetaByCode(tbl.Columns[idx].ColumnName);
                    column.ToolTipText      = meta.Name;
                    column.HeaderText       = meta.ClassType.Name.Trim();
                    column.Width            = 90;
                    column.DefaultCellStyle = amountCellStyle;
                }
                column.Name = idx.ToString();
            }
            SetResultDataGridText();
        }
        private void InitGrid()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmExport));
            // add column thuoc

            var clId = new DataGridViewTextBoxColumn { HeaderText = "Id", DataPropertyName = "Id", Name = "Id" };
            clId.Visible = false;
            grd.Columns.Add(clId);

            var clType = new DataGridViewTextBoxColumn { HeaderText = "Nhập/Xuất kho", DataPropertyName = "TypeName", Name = "TypeName" };
            grd.Columns.Add(clType);

            var clmInStock = new DataGridViewTextBoxColumn { HeaderText = "Ngày nhập/xuất", DataPropertyName = "Date", Name = "Date" };
            clmInStock.ReadOnly = true;
            clmInStock.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            grd.Columns.Add(clmInStock);

            var clmNo = new DataGridViewTextBoxColumn { HeaderText = "Mã chứng từ", DataPropertyName = "No", Name = "No" };
            clmNo.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            grd.Columns.Add(clmNo);

            var clmDeliverer = new DataGridViewTextBoxColumn { HeaderText = "Người giao", DataPropertyName = "Deliverer", Name = "Deliverer" };
            clmDeliverer.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            grd.Columns.Add(clmDeliverer);

            var clmNote = new DataGridViewTextBoxColumn { HeaderText = "Chú thích", DataPropertyName = "Note", Name = "Note" };
            clmNote.ReadOnly = true;
            clmNote.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            grd.Columns.Add(clmNote);
        }
Esempio n. 27
0
        public UniverseAdjuster(TrendUniverse UniverseAdjusterCollection)
        {
            InitializeComponent();
            DataGridViewColumn col = new DataGridViewTextBoxColumn();
            Universe.CopyContents(UniverseAdjusterCollection);
            UniBindSource.DataSource = Universe.TrendsUniverseContents;
            dgv_Universe.AutoGenerateColumns = false;
            dgv_Universe.DataSource = UniBindSource;
            col.DataPropertyName = "Symbol";
            dgv_Universe.Columns.Add(col);

            StocksToAdd.TrendsUniverseContents.AllowNew = true;
            dgv_StocksToAdd.AutoGenerateColumns = false;
            AddSource.DataSource = StocksToAdd.TrendsUniverseContents;
            dgv_StocksToAdd.DataSource = AddSource;
            col = new DataGridViewTextBoxColumn();
            col.DataPropertyName = "Symbol";
            dgv_StocksToAdd.Columns.Add(col);

            StocksToDelete.TrendsUniverseContents.AllowNew = true;
            dgv_StocksToDelete.AutoGenerateColumns = false;
            DeleteSource.DataSource = StocksToDelete.TrendsUniverseContents;
            dgv_StocksToDelete.DataSource = DeleteSource;
            col = new DataGridViewTextBoxColumn();
            col.DataPropertyName = "Symbol";
            dgv_StocksToDelete.Columns.Add(col);

            label_Count.Text = Universe.TrendsUniverseContents.Count.ToString();
            Universe.TrendsUniverseContents.ListChanged += new ListChangedEventHandler(StockUniverseContents_ListChanged);
        }
Esempio n. 28
0
        private void InitGrid()
        {
            // add column thuoc            
            var txtMed = new DataGridViewTextBoxColumn { HeaderText = "Thuốc", DataPropertyName = "MedicineName", Name = "MedicineName" };
            grd.Columns.Add(txtMed);

            var txtLotno = new DataGridViewTextBoxColumn { HeaderText = "Số lô", DataPropertyName = "LotNo", Name = "LotNo" };
            grd.Columns.Add(txtLotno);

            var txtSoLuong = new DataGridViewTextBoxColumn { HeaderText = "Số lượng", DataPropertyName = "Volumn", Name = "Volumn" };
            grd.Columns.Add(txtSoLuong);

            var clmUnitName = new DataGridViewTextBoxColumn { HeaderText = "Đơn vị", DataPropertyName = "UnitName", Name = "UnitName" };
            clmUnitName.ReadOnly = true;
            grd.Columns.Add(clmUnitName);

            var txtDonGia = new DataGridViewTextBoxColumn { HeaderText = "Đơn giá", DataPropertyName = "UnitPrice", Name = "UnitPrice" };
            grd.Columns.Add(txtDonGia);

            var txtThanhTien = new DataGridViewTextBoxColumn { HeaderText = "Thành tiền", DataPropertyName = "Amount", Name = "Amount" };
            txtThanhTien.ReadOnly = true;
            grd.Columns.Add(txtThanhTien);

            var dtExpireDate = new DataGridViewDateTimeInputColumn { HeaderText = "Ngày hết hạn", DataPropertyName = "ExpireDate", Name = "ExpireDate" };
            grd.Columns.Add(dtExpireDate);

            var txtGhiChu = new DataGridViewTextBoxColumn { HeaderText = "Ghi chú", DataPropertyName = "Note", Name = "Note" };
            txtGhiChu.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            grd.Columns.Add(txtGhiChu);
        }
Esempio n. 29
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="headerText"></param>
 /// <param name="dataPropertyName"></param>
 void AddColumn(string headerText, string dataPropertyName)
 {
     DataGridViewColumn c = new DataGridViewTextBoxColumn();
     c.HeaderText = headerText;
     c.DataPropertyName = dataPropertyName;
     this.dataGridView1.Columns.Add(c);
 }
        void dataBind()
        {
            try
            {
                con.Open();
                string strQuerry;
                strQuerry = "SELECT ProductName, Size FROM tblProduct";
                SqlCommand cmd = new SqlCommand(strQuerry, con);
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataTable dt = new DataTable();
                da.Fill(dt);
                dgvStichingReturn.DataSource = dt;
                con.Close();
                this.dgvStichingReturn.Columns["ProductName"].Width = 400;
                this.dgvStichingReturn.Columns["Size"].Width = 100;

                this.dgvStichingReturn.Columns["ProductName"].ReadOnly = true;
                this.dgvStichingReturn.Columns["Size"].ReadOnly = true;
                this.dgvStichingReturn.AllowUserToOrderColumns = false;
                this.dgvStichingReturn.AllowUserToResizeColumns = false;

                DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn();
                col.Name = "Quantity";
                int w = int.Parse(col.Index.ToString());
                col.HeaderText = "Quantity";
                col.Width = 150;

                dgvStichingReturn.Columns.Add(col);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 31
0
        public ResultTable(DataGridView dataView, string[] names)                                 // constructor.  Uses array of names for column/row header labels
        {
            m_dataView = dataView;
            m_results = new Result[m_numberOfSequences, m_numberOfSequences];

            for (int i = 0; i < m_numberOfSequences; ++i)
            {
                DataGridViewTextBoxColumn column = new DataGridViewTextBoxColumn();
                column.HeaderText = "seq" + (i+1);
                column.MaxInputLength = 8;
                column.Width = 50;
                DataGridViewCell cell = new DataGridViewTextBoxCell();
                column.CellTemplate = cell;
                m_dataView.Columns.Add(column);
            }
            for (int j = 0; j < m_numberOfSequences; ++j)
            {
                DataGridViewRow row = new DataGridViewRow();                                    // how can I remove the dumb current cell pointer that makes the header cells so big/obfuscates the header text?
                row.HeaderCell.Value = "seq"+(j+1);
                row.Height = 20;
                for (int i = 0; i < m_numberOfSequences; ++i)
                {
                    DataGridViewCell cell = new DataGridViewTextBoxCell();
                    row.Cells.Add(cell);
                }
                dataView.RowHeadersWidthSizeMode=DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
                m_dataView.Rows.Add(row);
            }
            dataView.CurrentCell = null;
        }
        public override void BuildTable(DataGridView dgv, object[] items)
        {
            dgv.AllowUserToAddRows = false;
            dgv.AllowUserToDeleteRows = false;

            DataGridViewColumn col;
            string[] col_names = { "Index", "Text" };

            for (int i = 0; i < col_names.Length; i++)
            {
                col = new DataGridViewTextBoxColumn();
                col.Name = col_names[i];
                dgv.Columns.Add(col);
            }

            for (int i = 0; i < items.Length; i++)
            {
                MuDef.MUFile_ItemSetOptionText Item;

                if (items[i] != null)
                {
                    Item = (MuDef.MUFile_ItemSetOptionText)items[i];
                    dgv.Rows.Add(Item.Index, Item.Text);
                }
            }

            EnumerateLines(dgv);
        }
        internal NewSportsFestivalGUI(NewSportsFestivalController controller)
        {
            InitializeComponent();

            this.StyleManager = metroStyleManager;

            DataGridViewCheckBoxColumn checkboxColumn = new DataGridViewCheckBoxColumn();
            checkboxColumn.HeaderText = "";
            checkboxColumn.Name = competitionGridColumn0Name;
            checkboxColumn.Width = 50;

            DataGridViewTextBoxColumn competitionIdColumn = new DataGridViewTextBoxColumn();
            competitionIdColumn.HeaderText = "Wettkampf-ID";
            competitionIdColumn.Name = competitionGridColumn1Name;
            competitionIdColumn.Visible = false;

            DataGridViewTextBoxColumn competitionNameColumn = new DataGridViewTextBoxColumn();
            competitionNameColumn.HeaderText = "Wettkampf";
            competitionNameColumn.Name = competitionGridColumn2Name;
            competitionNameColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            competitionNameColumn.ReadOnly = true;

            competitionGrid.Columns.Add(checkboxColumn);
            competitionGrid.Columns.Add(competitionIdColumn);
            competitionGrid.Columns.Add(competitionNameColumn);
        }
        private void InitGrid(bool isReadOnly)
        {
            var clId = new DataGridViewTextBoxColumn { HeaderText = "Id", DataPropertyName = "Id", Name = "Id" };
            clId.Visible = false;
            grd.Columns.Add(clId);

            var clMedicineId = new DataGridViewTextBoxColumn { HeaderText = "Mã thuốc", DataPropertyName = "MedicineId", Name = "MedicineId" };
            clMedicineId.Visible = false;
            grd.Columns.Add(clMedicineId);

            var clMedicineName = new DataGridViewTextBoxColumn { HeaderText = "Tên thuốc", DataPropertyName = "MedicineName", Name = "MedicineName" };
            clMedicineName.ReadOnly = true;
            grd.Columns.Add(clMedicineName);

            var clInStock = new DataGridViewTextBoxColumn { HeaderText = "Số thuốc trong kho", DataPropertyName = "InStock", Name = "InStock" };
            clInStock.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            clInStock.ReadOnly = true;
            grd.Columns.Add(clInStock);

            var clLastMonthUsage = new DataGridViewTextBoxColumn { HeaderText = "Số thuốc dùng tháng trước", DataPropertyName = "LastMonthUsage", Name = "LastMonthUsage" };
            clLastMonthUsage.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            clLastMonthUsage.ReadOnly = true;
            grd.Columns.Add(clLastMonthUsage);

            var clCurrentMonthUsage = new DataGridViewTextBoxColumn { HeaderText = "Số thuốc tháng này đã dùng", DataPropertyName = "CurrentMonthUsage", Name = "CurrentMonthUsage" };
            clCurrentMonthUsage.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            clCurrentMonthUsage.ReadOnly = true;
            grd.Columns.Add(clCurrentMonthUsage);

            var clRequired = new DataGridViewTextBoxColumn { HeaderText = "Số thuốc mong muốn", DataPropertyName = "Required", Name = "Required" };
            clRequired.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            clRequired.ReadOnly = !isReadOnly;
            grd.Columns.Add(clRequired);
        }
Esempio n. 35
0
 private void InitGridColumns(DateTime begin, DateTime end)
 {
     if (_DateColumns != null && _DateColumns.Count > 0)
     {
         foreach (DataGridViewColumn col in _DateColumns)
         {
             this.GridView.Columns.Remove(col);
         }
         _DateColumns.Clear();
     }
     while (end >= begin)
     {
         DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn();
         col.Tag = begin;
         col.Width = 30;
         col.ReadOnly = true;
         col.SortMode = DataGridViewColumnSortMode.NotSortable;
         col.AutoSizeMode = DataGridViewAutoSizeColumnMode.NotSet;
         col.HeaderText = begin.Day.ToString("D2");
         if (HolidaySetting.Current != null && (HolidaySetting.Current.IsHoliday(begin) || HolidaySetting.Current.IsWeekend(begin)))
         {
             col.DefaultCellStyle.BackColor = Color.LightGray;
         }
         else
         {
             col.DefaultCellStyle.BackColor = Color.White;
         }
         _DateColumns.Add(col);
         begin = begin.AddDays(1);
     }
     for (int i = 0; i < _DateColumns.Count; i++)
     {
         GridView.Columns.Insert(i + 1, _DateColumns[i]);
     }
 }
Esempio n. 36
0
        private List<DataGridViewColumn> GetColumns()
        {
            List<DataGridViewColumn> columns;
            DataGridViewTextBoxColumn column;

            columns = new List<DataGridViewColumn>();

            column = new DataGridViewTextBoxColumn();
            column.Name = "id";
            column.DataPropertyName = "Id";
            column.Visible = false;
            columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.Name = "categoryId";
            column.DataPropertyName = "CategoryId";
            column.Visible = false;
            columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.Name = "name";
            column.DataPropertyName = "Name";
            column.HeaderText = "Name";
            column.Width = 200;
            columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.Name = "categoryName";
            column.DataPropertyName = "CategoryName";
            column.HeaderText = "Category Name";
            column.Width = 200;
            columns.Add(column);

            return columns;
        }
Esempio n. 37
0
        public MazeGUI_Example(int x, int y, int selfx, int selfy, int goalx, int goaly)
        {
            InitializeComponent();
            Width = 60 + x * 25;
            Height = 60 + y * 25;
            for (int i = 0; i < x; i++)
            {
                DataGridViewColumn c = new DataGridViewTextBoxColumn();
                c.Name = "" + i;
                c.HeaderText = "" + i;
                c.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                c.FillWeight = Math.Max(1, 100 / x);
                grid.Columns.Add(c);
            }
            for (int i = 0; i < y; i++)
            {
                grid.Rows.Add("");
                grid.Rows[i].HeaderCell.Value = "" + i;
            }

            SetSelf(selfx, selfy);
            SetGoal(goalx, goaly);

            KeyDown += (o, s) => { OK_Click(); };
            grid.KeyDown += (o, s) => { OK_Click(); };

        }
Esempio n. 38
0
        public ReceiptGridView()
        {
            //
            //
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
            Receipt_id         = new DataGridViewButtonColumn();
            Receipt_name_class = new System.Windows.Forms.DataGridViewTextBoxColumn();
            Receipt_name       = new System.Windows.Forms.DataGridViewTextBoxColumn();
            Receipt_date       = new System.Windows.Forms.DataGridViewTextBoxColumn();
            Receipt_comment    = new System.Windows.Forms.DataGridViewTextBoxColumn();

            this.AllowUserToAddRows                   = false;
            this.AllowUserToDeleteRows                = false;
            this.AllowUserToOrderColumns              = true;
            this.AutoSizeColumnsMode                  = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
            this.AutoGenerateColumns                  = false;
            dataGridViewCellStyle1.Alignment          = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle1.BackColor          = System.Drawing.SystemColors.Control;
            dataGridViewCellStyle1.Font               = new System.Drawing.Font("Meiryo UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
            dataGridViewCellStyle1.ForeColor          = System.Drawing.SystemColors.WindowText;
            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle1.WrapMode           = System.Windows.Forms.DataGridViewTriState.True;
            this.ColumnHeadersDefaultCellStyle        = dataGridViewCellStyle1;
            this.ColumnHeadersHeightSizeMode          = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
        }
        public void LoadListaVariaveis(List<MaquinaInequacoesServiceReference.Variavel> variaveis)
        {
            dataGridView3.AutoGenerateColumns = false;
            dataGridView3.DataSource = variaveis;

            DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn();
            chk.HeaderText = "X";
            chk.Name = "chkVariaveis";
            dataGridView3.Columns.Add(chk);
            //dataGridView3.Columns.Add(CreateComboBoxOrdem());

            DataGridViewColumn column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Nome";
            column.Name = "Variavel";
            dataGridView3.Columns.Add(column);

            /*
            DataGridViewComboBoxColumn cmb = new DataGridViewComboBoxColumn();
            cmb.HeaderText = "Ordem";
            cmb.Name = "cmbOrdem";
            cmb.MaxDropDownItems = 100;
            for (int i = 0; i < 100; i++)
            {
                cmb.Items.Add(i);
            }
            dataGridView3.Columns.Add(cmb);

            foreach (DataGridViewRow row in dataGridView3.Rows)
            {
                row.Cells[chk.Name].Value = false;
                //(row.Cells[cmb.Name] as DataGridViewComboBoxCell).Value = 0;
            }
            */
        }
Esempio n. 40
0
        private DataGridView NewHoseView()
        {
            DataGridView HoseView = new System.Windows.Forms.DataGridView();

            HoseView.CellClick += new DataGridViewCellEventHandler(hoseView_CellClick);
            #region Columns
            DataGridViewTextBoxColumn hID      = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn hRoom    = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn hLoc     = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn hSerial  = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn hBarCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn hManDate = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewButtonColumn  hDel     = new DataGridViewButtonColumn();

            hID.HeaderText      = "ID";
            hID.Name            = "hID";
            hID.Visible         = false;
            hRoom.HeaderText    = "Room";
            hRoom.Name          = "hRoom";
            hRoom.Visible       = false;
            hRoom.Width         = 60;
            hLoc.HeaderText     = "Location";
            hLoc.Name           = "hLoc";
            hLoc.Width          = 80;
            hSerial.HeaderText  = "Serial";
            hSerial.Name        = "hSerial";
            hSerial.Width       = 150;
            hDel.HeaderText     = "Delete";
            hDel.Name           = "hDel";
            hDel.Width          = 40;
            hBarCode.HeaderText = "Bar Code";
            hBarCode.Name       = "hBarCode";
            hBarCode.Width      = 80;
            hManDate.HeaderText = "Manufacturing Date";
            hManDate.Name       = "hManDate";
            hManDate.Width      = 150;
            #endregion

            HoseView.AllowUserToAddRows          = false;
            HoseView.AllowUserToDeleteRows       = false;
            HoseView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            HoseView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
                hID,
                hLoc,
                hSerial,
                hRoom,
                hBarCode,
                hManDate,
                hDel
            });

            HoseView.Location = new System.Drawing.Point(5, 220);
            HoseView.Name     = "HoseView";
            HoseView.Size     = new System.Drawing.Size(AddItemButton.Location.X - HoseView.Location.X - 10, 150);
            HoseView.TabIndex = 65;
            HoseView.Visible  = false;

            return(HoseView);
        }
Esempio n. 41
0
/*
 *      public BomOfferCustVendor(bool isOffer):this()
 *      {
 *          this.isOffer = isOffer;
 *
 *          if (isOffer)
 *          {
 *              this.Text = "Vendors For Excess";
 *              this.toolStripButton1.Text = "New Vendor";
 *              this.tsbImportFromExcel.Text = "Import Offer";
 *              this.tsbNewBomOff.Text = "New Offer";
 *              this.tsbDelete.Text = "Delete";
 *
 *              this.tscbSearchBy.Items.Add("Vendor Name");
 *
 *          }
 *          else
 *          {
 *              this.Text = "Customer For BOMs";
 *              this.toolStripButton1.Text = "New Customer";
 *              this.tsbImportFromExcel.Text = "Import BOM";
 *              this.tsbNewBomOff.Text = "New BOM";
 *              this.tsbDelete.Text="Delete";
 *              this.tscbSearchBy.Items.Add("Customer Name");
 *          }
 *
 *          FillTheDataGridViewColumn();
 *
 *
 *      }*/


        private void FillTheDataGridViewColumn()
        {
            System.Windows.Forms.DataGridViewTextBoxColumn Id       = new System.Windows.Forms.DataGridViewTextBoxColumn();
            System.Windows.Forms.DataGridViewTextBoxColumn Company  = new System.Windows.Forms.DataGridViewTextBoxColumn();
            System.Windows.Forms.DataGridViewTextBoxColumn Contact  = new System.Windows.Forms.DataGridViewTextBoxColumn();
            System.Windows.Forms.DataGridViewTextBoxColumn Tel      = new System.Windows.Forms.DataGridViewTextBoxColumn();
            System.Windows.Forms.DataGridViewTextBoxColumn Email    = new System.Windows.Forms.DataGridViewTextBoxColumn();
            System.Windows.Forms.DataGridViewTextBoxColumn User     = new System.Windows.Forms.DataGridViewTextBoxColumn();
            System.Windows.Forms.DataGridViewTextBoxColumn EnterDay = new System.Windows.Forms.DataGridViewTextBoxColumn();

            Id.Name    = "Id";
            Id.Visible = false;

            Company.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
            if (this.bomOfferType == BomOfferTypeEnum.Excess)
            {
                Company.HeaderText = "Vendor";
            }
            else if (this.bomOfferType == BomOfferTypeEnum.BOM)
            {
                Company.HeaderText = "Customer";
            }
            else
            {
                Company.HeaderText = "Company";
            }
            Company.Name = "Compnay";

            Contact.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
            Contact.HeaderText   = "Contact";
            Contact.Name         = "Contact";

            Tel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
            Tel.HeaderText   = "Tel";
            Tel.Name         = "Tel";

            Email.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
            Email.HeaderText   = "Email";
            Email.Name         = "Email";

            User.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
            User.HeaderText   = "Owner";
            User.Name         = "User";

            EnterDay.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
            EnterDay.HeaderText   = "Enter Day";
            EnterDay.Name         = "EnterDay";

            dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
                Id,
                Company,
                Contact,
                Tel,
                Email,
                User,
                EnterDay
            });
        }
Esempio n. 42
0
        private void SetupComponent()
        {
            this.AllowUserToAddRows          = false;
            this.AllowUserToDeleteRows       = false;
            this.AllowUserToResizeColumns    = false;
            this.AllowUserToResizeRows       = false;
            this.AutoGenerateColumns         = false;
            this.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.ColumnHeadersVisible        = false;
            this.ShowCellToolTips            = false;

            System.Windows.Forms.DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            nameDataGridViewTextBoxColumn.DataPropertyName = "Name";
            nameDataGridViewTextBoxColumn.HeaderText       = "Task";
            nameDataGridViewTextBoxColumn.Name             = "nameDataGridViewTextBoxColumn";
            nameDataGridViewTextBoxColumn.ReadOnly         = true;
            nameDataGridViewTextBoxColumn.Width            = 400;
            nameDataGridViewTextBoxColumn.Frozen           = true;
            this.Columns.Clear();
            this.Columns.Add(nameDataGridViewTextBoxColumn);

            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
            dataGridViewCellStyle1.Alignment          = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle1.BackColor          = System.Drawing.SystemColors.Window;
            dataGridViewCellStyle1.Font               = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dataGridViewCellStyle1.ForeColor          = System.Drawing.SystemColors.ControlText;
            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.ControlText;
            dataGridViewCellStyle1.WrapMode           = System.Windows.Forms.DataGridViewTriState.False;
            this.DefaultCellStyle        = dataGridViewCellStyle1;
            this.MultiSelect             = true;
            this.ReadOnly                = true;
            this.RowHeadersVisible       = false;
            this.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
            this.ClipboardCopyMode       = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
            this.DoubleBuffered          = true;
            this.ScrollBars              = ScrollBars.Both;

            MenuItem menuBreakdown = new MenuItem("Component Performance Breakdown");

            menuBreakdown.Click      += new EventHandler(menuBreakdown_Click);
            this.contextMenuBreakdown = new ContextMenu(new MenuItem[] { menuBreakdown });

            if (this.DataSource != null && this.DataSource is BindingSource)
            {
                List <IDtsGridRowData> list = ((BindingSource)this.DataSource).DataSource as List <IDtsGridRowData>;
                if (list != null)
                {
                    if (list.Count > 0)
                    {
                        if (list[0] is DtsPipelineTestDirector.DtsPipelineComponentTest)
                        {
                            nameDataGridViewTextBoxColumn.HeaderText = "Pipeline Component";
                        }
                    }
                }
            }
        }
Esempio n. 43
0
        public void TextBoxTest()
        {
            SWF.DataGridViewTextBoxColumn column = new SWF.DataGridViewTextBoxColumn();
            column.HeaderText = "Edit Column";

            SWF.DataGridViewTextBoxCell cell = new SWF.DataGridViewTextBoxCell();

            ColumnCellTest(column, cell, false);
        }
Esempio n. 44
0
        private void SetupComponent()
        {
            System.Windows.Forms.DataGridViewTextBoxColumn barDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            barDataGridViewTextBoxColumn.HeaderText = "Name";
            barDataGridViewTextBoxColumn.Name       = "barDataGridViewTextBoxColumn";
            barDataGridViewTextBoxColumn.ReadOnly   = true;
            barDataGridViewTextBoxColumn.Width      = 0;
            this.Columns.Add(barDataGridViewTextBoxColumn);

            this.BackgroundColor = Color.White;
        }
Esempio n. 45
0
        private void SetGridColumns()
        {
            gridViewBooks.AutoGenerateColumns = false;
            DataGridViewTextBoxColumn dgvcTitle = new System.Windows.Forms.DataGridViewTextBoxColumn();

            dgvcTitle.DataPropertyName = "Title";
            dgvcTitle.Name             = "Title";
            dgvcTitle.HeaderText       = "Title";
            dgvcTitle.AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells;
            gridViewBooks.Columns.Add(dgvcTitle);
            DataGridViewTextBoxColumn dgvcAuthor = new System.Windows.Forms.DataGridViewTextBoxColumn();

            dgvcAuthor.DataPropertyName = "Author";
            dgvcAuthor.Name             = "Author";
            dgvcAuthor.HeaderText       = "Author";
            dgvcAuthor.AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells;
            gridViewBooks.Columns.Add(dgvcAuthor);
            DataGridViewTextBoxColumn dgvcType = new System.Windows.Forms.DataGridViewTextBoxColumn();

            dgvcType.DataPropertyName = "Type";
            dgvcType.Name             = "Type";
            dgvcType.HeaderText       = "Type";
            dgvcType.AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells;
            gridViewBooks.Columns.Add(dgvcType);
            DataGridViewTextBoxColumn dgvcGenre = new System.Windows.Forms.DataGridViewTextBoxColumn();

            dgvcGenre.DataPropertyName = "Genre";
            dgvcGenre.Name             = "Genre";
            dgvcGenre.HeaderText       = "Genre";
            dgvcGenre.AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells;
            gridViewBooks.Columns.Add(dgvcGenre);
            DataGridViewTextBoxColumn dgvcYear = new System.Windows.Forms.DataGridViewTextBoxColumn();

            dgvcYear.DataPropertyName = "Year";
            dgvcYear.Name             = "Year";
            dgvcYear.HeaderText       = "Year";
            dgvcYear.AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells;
            gridViewBooks.Columns.Add(dgvcYear);
            DataGridViewTextBoxColumn dgvcIsbn = new System.Windows.Forms.DataGridViewTextBoxColumn();

            dgvcIsbn.DataPropertyName = "Isbn";
            dgvcIsbn.Name             = "Isbn";
            dgvcIsbn.HeaderText       = "Isbn";
            dgvcIsbn.AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells;
            gridViewBooks.Columns.Add(dgvcIsbn);
            DataGridViewTextBoxColumn dgvcReserved = new System.Windows.Forms.DataGridViewTextBoxColumn();

            dgvcReserved.DataPropertyName = "Reserved";
            dgvcReserved.Name             = "Reserved";
            dgvcReserved.HeaderText       = "Reserved";
            dgvcReserved.AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells;
            gridViewBooks.Columns.Add(dgvcReserved);
        }
Esempio n. 46
0
        private void InitColumn()
        {
            System.Windows.Forms.DataGridViewTextBoxColumn nomeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();

            nomeDataGridViewTextBoxColumn.DataPropertyName = "Nome";
            nomeDataGridViewTextBoxColumn.HeaderText       = "Nome";
            nomeDataGridViewTextBoxColumn.MinimumWidth     = 8;
            nomeDataGridViewTextBoxColumn.Name             = "nomeDataGridViewTextBoxColumn";
            nomeDataGridViewTextBoxColumn.ReadOnly         = true;
            nomeDataGridViewTextBoxColumn.Width            = 150;

            this.dataGridView1.Columns.Insert(0, nomeDataGridViewTextBoxColumn);
        }
Esempio n. 47
0
        public void RefreshGrid(BaseCriteriaCollection bcc) //ControlSchema template, BaseCriteriaCollection criteria=null)
        {
            string tableName = this["TableName"].GetValue <string>("");

            string[] columns = this["Columns"].GetValue <string[]>(null);
            string[] titles  = this["ColumnHeaders"].GetValue <string[]>(null);

            int            i  = 0;
            DataTable      dt = new DataTable();
            SelectCriteria sc = new SelectCriteria();

            sc.fields = new System.Collections.ArrayList();

            ctl.Columns.Clear();

            foreach (string column in columns)
            {
                WinUI.DataGridViewTextBoxColumn col = new WinUI.DataGridViewTextBoxColumn();
                col.HeaderText       = titles[i++];
                col.DataPropertyName = column;
                col.Name             = column;

                ctl.Columns.Add(col);

                dt.Columns.Add(column);
                sc.fields.Add(column);
            }

            if (bcc != null)
            {
                sc.Criteria = bcc;
            }

            //sc.Criteria = criteria;

            DynamicRowCollection rows = DynamicRow.FindRows(tableName, sc);

            for (i = 0; i < rows.Count; i++)
            {
                DataRow dr = dt.NewRow();

                foreach (string column in columns)
                {
                    dr[column] = rows[i][column].fValue;
                }

                dt.Rows.Add(dr);
            }

            ctl.DataSource = dt;
        }
Esempio n. 48
0
 private void CreateColumnsHeaders(DataGridView grid)
 {
     grid.Columns.Clear();
     DataGridViewColumn[] newColumns = new DataGridViewColumn[gridB.Rows.Count - 1];
     for (int i = 0; i < newColumns.Length; i++)
     {
         DataGridViewTextBoxColumn ColC = new System.Windows.Forms.DataGridViewTextBoxColumn();
         grid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { ColC });
         ColC.FillWeight = 50F;
         ColC.HeaderText = "B" + (grid.Columns.Count).ToString();
         ColC.Name       = (grid.Columns.Count).ToString();
         ColC.Width      = 50;
     }
 }
        public void SetDataGirdStyleForClass()
        {
            this.dgvDetails.Columns.Clear();
            this.Tag = "Class";
            DataGridViewTextBoxColumn colClassName    = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn colDirector     = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn colCurrentCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn colEntranceDate = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn colRemark       = new System.Windows.Forms.DataGridViewTextBoxColumn();

            this.dgvDetails.AllowUserToAddRows          = false;
            this.dgvDetails.AllowUserToDeleteRows       = false;
            this.dgvDetails.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dgvDetails.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
                colClassName,
                colDirector,
                colCurrentCount,
                colEntranceDate,
                colRemark
            });

            colClassName.DataPropertyName = "ClassName";
            colClassName.HeaderText       = "班级名称";
            colClassName.Name             = "colClassName";
            colClassName.ReadOnly         = true;
            colClassName.Frozen           = false;

            colDirector.DataPropertyName = "Director";
            colDirector.HeaderText       = "班主任";
            colDirector.Name             = "colDirector";
            colDirector.ReadOnly         = true;
            colDirector.Width            = 80;

            colCurrentCount.DataPropertyName = "CurrentCount";
            colCurrentCount.HeaderText       = "学生人数";
            colCurrentCount.Name             = "colCurrentCount";
            colCurrentCount.ReadOnly         = true;
            colCurrentCount.Width            = 80;

            colEntranceDate.DataPropertyName = "EntranceDate";
            colEntranceDate.HeaderText       = "建班日期";
            colEntranceDate.Name             = "colEntranceDate";
            colEntranceDate.ReadOnly         = true;

            colRemark.DataPropertyName = "Remark";
            colRemark.HeaderText       = "备注";
            colRemark.Name             = "colRemark";
            colRemark.ReadOnly         = true;
            colRemark.Width            = 450;
        }
Esempio n. 50
0
        private void LoadObiedinenie(Context.voenniy_okrugEntities context)
        {
            string[] columnNames = control.GetDgvFormatObiedinenie();
            //dgvOb.Columns.Clear();

            foreach (string columnName in columnNames)
            {
                System.Windows.Forms.DataGridViewTextBoxColumn column = new System.Windows.Forms.DataGridViewTextBoxColumn();
                column.HeaderText = columnName;
                // dgvOb.Columns.Add(column);
            }

            lblSsPage.Text = "1";
        }
Esempio n. 51
0
 /// <summary>
 /// Initialize the loadNaturesDataGridView
 /// </summary>
 private void InitializeLoadNaturesDataGridView()
 {
     this.LoadNatureName = new System.Windows.Forms.DataGridViewTextBoxColumn();
     loadNaturesDataGridView.AutoGenerateColumns = false;
     this.loadNaturesDataGridView.Columns.AddRange(new DataGridViewColumn[] { this.LoadNatureName });
     loadNaturesDataGridView.DataSource         = m_dataBuffer.LoadNaturesMap;
     this.LoadNatureName.DataPropertyName       = "LoadNaturesName";
     this.LoadNatureName.HeaderText             = "Name";
     this.LoadNatureName.Name                   = "LoadNaturesName";
     this.LoadNatureName.ReadOnly               = false;
     this.LoadNatureName.Width                  = loadCasesDataGridView.Width - 100;
     this.loadNaturesDataGridView.MultiSelect   = false;
     this.loadNaturesDataGridView.SelectionMode = DataGridViewSelectionMode.CellSelect;
 }
Esempio n. 52
0
        private void LoadSooruzhenie()
        {
            string[] columnNames = control.GetDgvFormatSooruzhenie();
            dgvSo.Columns.Clear();

            foreach (string columnName in columnNames)
            {
                System.Windows.Forms.DataGridViewTextBoxColumn column = new System.Windows.Forms.DataGridViewTextBoxColumn();
                column.HeaderText = columnName;
                dgvSo.Columns.Add(column);
            }

            lblSoPage.Text = "1";
        }
Esempio n. 53
0
        private void LoadStarshiySluzhaschiy(Context.voenniy_okrugEntities context)
        {
            string[] columnNames = control.GetDgvFormatStarshiySluzhaschiy();
            dgvSs.Columns.Clear();

            foreach (string columnName in columnNames)
            {
                System.Windows.Forms.DataGridViewTextBoxColumn column = new System.Windows.Forms.DataGridViewTextBoxColumn();
                column.HeaderText = columnName;
                dgvSs.Columns.Add(column);
            }

            lblSsPage.Text = "1";
        }
Esempio n. 54
0
        private void LoadChasti(Context.voenniy_okrugEntities context)
        {
            string[] columnNames = control.GetDgvFormatChasti();
            dgvCh.Columns.Clear();

            foreach (string columnName in columnNames)
            {
                System.Windows.Forms.DataGridViewTextBoxColumn column = new System.Windows.Forms.DataGridViewTextBoxColumn();
                column.HeaderText = columnName;
                dgvCh.Columns.Add(column);
            }

            lblChPage.Text = "1";
            var obiedineniya = context.Obiedinenie.ToList();
        }
Esempio n. 55
0
        protected override void InitializeData()
        {
            var column = new System.Windows.Forms.DataGridViewTextBoxColumn();

            column.Name             = string.Format("col_{0}", 1);
            column.DefaultCellStyle = dataGridViewCellStyle1;
            column.AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells;

            _dataGrid.Columns.Add(column);

            _dataGrid.Rows.Add();

            _dataGrid.Rows[0].Cells[0].Tag   = _number;
            _dataGrid.Rows[0].Cells[0].Value = _number.ToString(false);
        }
        public void SetDataGridStyleForCourse()
        {
            this.dgvDetails.Columns.Clear();
            this.Tag = "Course";
            DataGridViewTextBoxColumn SubjectName = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn Teacher     = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn BeginDate   = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn FinishDate  = new System.Windows.Forms.DataGridViewTextBoxColumn();
            DataGridViewTextBoxColumn Remark      = new System.Windows.Forms.DataGridViewTextBoxColumn();

            dgvDetails.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
                SubjectName,
                Teacher,
                BeginDate,
                FinishDate,
                Remark
            });

            SubjectName.DataPropertyName = "SubjectName";
            SubjectName.Frozen           = true;
            SubjectName.HeaderText       = "科目名称";
            SubjectName.Name             = "SubjectName";
            SubjectName.ReadOnly         = true;
            SubjectName.Width            = 200;

            Teacher.DataPropertyName = "Teacher";
            Teacher.HeaderText       = "授课老师";
            Teacher.Name             = "Teacher";
            Teacher.ReadOnly         = true;

            BeginDate.DataPropertyName = "BeginDate";
            BeginDate.HeaderText       = "开课日期";
            BeginDate.Name             = "BeginDate";
            BeginDate.ReadOnly         = true;
            BeginDate.Width            = 150;

            FinishDate.DataPropertyName = "FinishDate";
            FinishDate.HeaderText       = "结课日期";
            FinishDate.Name             = "FinishDate";
            FinishDate.ReadOnly         = true;
            FinishDate.Width            = 150;

            Remark.DataPropertyName = "Remark";
            Remark.HeaderText       = "备注";
            Remark.Name             = "Remark";
            Remark.ReadOnly         = true;
            Remark.Width            = 500;
        }
Esempio n. 57
0
        /// <summary>
        /// Initialize the loadCasesDataGridView
        /// </summary>
        private void InitializeLoadCasesDataGridView()
        {
            this.LoadCasesName     = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.LoadCasesNumber   = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.LoadCasesNature   = new System.Windows.Forms.DataGridViewComboBoxColumn();
            this.LoadCasesCategory = new System.Windows.Forms.DataGridViewComboBoxColumn();
            loadCasesDataGridView.AutoGenerateColumns = false;
            this.loadCasesDataGridView.Columns.AddRange(new DataGridViewColumn[] { this.LoadCasesName, this.LoadCasesNumber, this.LoadCasesNature, this.LoadCasesCategory });
            loadCasesDataGridView.DataSource = m_dataBuffer.LoadCasesMap;

            this.LoadCasesName.DataPropertyName = "LoadCasesName";
            this.LoadCasesName.HeaderText       = "Name";
            this.LoadCasesName.Name             = "LoadCasesName";
            this.LoadCasesName.ReadOnly         = false;
            this.LoadCasesName.Width            = loadCasesDataGridView.Width / 6;

            this.LoadCasesNumber.DataPropertyName = "LoadCasesNumber";
            this.LoadCasesNumber.HeaderText       = "Case Number";
            this.LoadCasesNumber.Name             = "LoadCasesNumber";
            this.LoadCasesNumber.ReadOnly         = true;
            this.LoadCasesNumber.Width            = loadCasesDataGridView.Width / 4;

            this.LoadCasesNature.DataPropertyName = "LoadCasesNatureId";
            this.LoadCasesNature.DisplayStyle     = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing;
            this.LoadCasesNature.HeaderText       = "Nature";
            this.LoadCasesNature.Name             = "LoadCasesNature";
            this.LoadCasesNature.Resizable        = System.Windows.Forms.DataGridViewTriState.True;
            this.LoadCasesNature.SortMode         = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
            this.LoadCasesNature.Width            = loadCasesDataGridView.Width / 4;

            LoadCasesNature.DataSource    = m_dataBuffer.LoadNatures;
            LoadCasesNature.DisplayMember = "Name";
            LoadCasesNature.ValueMember   = "Id";

            this.LoadCasesCategory.DataPropertyName = "LoadCasesCategoryId";
            this.LoadCasesCategory.DisplayStyle     = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing;
            this.LoadCasesCategory.HeaderText       = "Category";
            this.LoadCasesCategory.Name             = "LoadCasesCategory";
            this.LoadCasesCategory.Resizable        = System.Windows.Forms.DataGridViewTriState.True;
            this.LoadCasesCategory.SortMode         = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
            this.LoadCasesCategory.Width            = loadCasesDataGridView.Width / 4;

            LoadCasesCategory.DataSource             = m_dataBuffer.LoadCasesCategory;
            LoadCasesCategory.DisplayMember          = "Name";
            LoadCasesCategory.ValueMember            = "Id";
            this.loadCasesDataGridView.MultiSelect   = false;
            this.loadCasesDataGridView.SelectionMode = DataGridViewSelectionMode.CellSelect;
        }
        private void CreateColumns()
        {
            if (this.Columns.Count == 0)
            {
                DataGridViewTextBoxColumn Id        = new System.Windows.Forms.DataGridViewTextBoxColumn();
                DataGridViewTextBoxColumn ItemName  = new System.Windows.Forms.DataGridViewTextBoxColumn();
                DataGridViewTextBoxColumn Quantity  = new System.Windows.Forms.DataGridViewTextBoxColumn();
                DataGridViewTextBoxColumn UnitPrice = new System.Windows.Forms.DataGridViewTextBoxColumn();
                DataGridViewTextBoxColumn Total     = new System.Windows.Forms.DataGridViewTextBoxColumn();

                Id.HeaderText = "Id";
                Id.Name       = "Id";
                Id.Visible    = false;
                //
                // ItemName
                //
                ItemName.HeaderText = "Description";
                ItemName.Name       = "ItemName";
                ItemName.Width      = 240;
                //
                // Quantity
                //
                Quantity.HeaderText = "Qty";
                Quantity.Name       = "Quantity";
                Quantity.Width      = 50;
                //
                // UnitPrice
                //
                UnitPrice.HeaderText = "Unit";
                UnitPrice.Name       = "UnitPrice";
                UnitPrice.Width      = 50;
                //
                // Total
                //
                Total.HeaderText = "Total";
                Total.Name       = "Total";
                Total.Width      = 50;

                this.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
                    Id,
                    ItemName,
                    Quantity,
                    UnitPrice,
                    Total
                });
            }
        }
 private void CreateDataGrid()
 {
     dataGrid = new DataGridView();
     ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
     System.Windows.Forms.DataGridViewCellStyle     dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle     dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewTextBoxColumn KOD  = new System.Windows.Forms.DataGridViewTextBoxColumn();
     System.Windows.Forms.DataGridViewTextBoxColumn Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Name.ReadOnly   = true;
     KOD.HeaderText  = "Код";
     KOD.Name        = "KOD";
     Name.HeaderText = "Содержание компетенции";
     Name.Name       = "Name";
     Name.Width      = 600;
     this.dataGrid.AllowUserToAddRows = false;
     this.dataGrid.Anchor             = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                               | System.Windows.Forms.AnchorStyles.Left)
                                                                              | System.Windows.Forms.AnchorStyles.Right)));
     dataGridViewCellStyle1.Alignment            = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
     dataGridViewCellStyle1.BackColor            = System.Drawing.SystemColors.Control;
     dataGridViewCellStyle1.Font                 = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
     dataGridViewCellStyle1.ForeColor            = System.Drawing.SystemColors.WindowText;
     dataGridViewCellStyle1.SelectionBackColor   = System.Drawing.SystemColors.Highlight;
     dataGridViewCellStyle1.SelectionForeColor   = System.Drawing.SystemColors.HighlightText;
     dataGridViewCellStyle1.WrapMode             = System.Windows.Forms.DataGridViewTriState.True;
     this.dataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
     this.dataGrid.ColumnHeadersHeightSizeMode   = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     this.dataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { KOD, Name });
     dataGridViewCellStyle2.Alignment          = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
     dataGridViewCellStyle2.BackColor          = System.Drawing.SystemColors.Window;
     dataGridViewCellStyle2.Font               = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
     dataGridViewCellStyle2.ForeColor          = System.Drawing.SystemColors.ControlText;
     dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
     dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
     dataGridViewCellStyle2.WrapMode           = System.Windows.Forms.DataGridViewTriState.False;
     this.dataGrid.DefaultCellStyle            = dataGridViewCellStyle2;
     this.dataGrid.Location       = new System.Drawing.Point(13, 90);
     this.dataGrid.Name           = "dataGridView1";
     this.dataGrid.Size           = new System.Drawing.Size((int)(0.95 * page.Width), (int)(0.8 * page.Height));
     dataGrid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
     dataGrid.CellEndEdit        += new DataGridViewCellEventHandler(dataGridView1_CellEndEdit);
     dataGrid.CellBeginEdit      += new DataGridViewCellCancelEventHandler(dataGridView1_CellBeginEdit);
     dataGrid.KeyUp += new KeyEventHandler(dataGridView1_KeyUp);
     ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).EndInit();
     page.Controls.Add(dataGrid);
 }
Esempio n. 60
0
        //функция для разбиения поля на ячейки
        public void Colums()
        {
            int k = this.dataGridView1.Size.Width / 30;

            System.Windows.Forms.DataGridViewColumn[] f = new System.Windows.Forms.DataGridViewColumn[] { };
            for (int i = 0; i < k; i++)
            {
                System.Windows.Forms.DataGridViewTextBoxColumn co = new System.Windows.Forms.DataGridViewTextBoxColumn();
                co.Width = 30;
                this.dataGridView1.Columns.Add(co);
            }
            k = this.dataGridView1.Size.Height / 30;

            for (int i = 0; i < k - 1; i++)
            {
                this.dataGridView1.Rows.Add();
            }
        }