Ejemplo n.º 1
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]];
            }
        }        
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
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
            });
        }
Ejemplo n.º 6
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]);
     }
 }
Ejemplo n.º 7
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);
        }
Ejemplo n.º 8
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 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;
 }
Ejemplo n.º 10
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(); };

        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
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);
        }
Ejemplo n.º 13
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);
 }
        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);
        }
        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);
        }
        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);
        }
Ejemplo n.º 17
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;
        }
        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);
        }
        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;
            }
            */
        }
Ejemplo n.º 20
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);
 }
Ejemplo n.º 21
0
 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);
 }
Ejemplo n.º 22
0
        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);
            }
        }
        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);
        }
Ejemplo n.º 24
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);
        }
Ejemplo n.º 25
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;
        }
Ejemplo n.º 26
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);
        }
Ejemplo n.º 27
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);
        }
Ejemplo n.º 28
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 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);
        }
Ejemplo n.º 30
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 });
        }