예제 #1
0
 private void dataGridView1_NewRowNeeded(object sender, System.Windows.Forms.DataGridViewRowEventArgs e)
 {
     // Create a new Customer object when the user edits
     // the row for new records.
     this.customerInEdit = new Customer();
     this.rowInEdit      = this.dataGridView1.Rows.Count - 1;
 }
예제 #2
0
        private void tablaDatos_UserAddedRow(object sender, DataGridViewRowEventArgs e)
        {
            tablaDatos.Rows[tablaDatos.Rows.Count - 1].ReadOnly = true;

            for (int j = 0; j < tablaDatos.Columns.Count; j++)
                tablaDatos.Rows[tablaDatos.Rows.Count - 1].Cells[j].Style.BackColor = Color.Gray;
        }
예제 #3
0
 private void dataGridView1_UserAddedRow(object sender, DataGridViewRowEventArgs e)
 {
     if (dataGridView1.Rows.Count == 12) {
         dataGridView1.AllowUserToAddRows = false;
         MessageBox.Show("Solo puedes agregar 11 elementos a la tabla.", "Advertencia", MessageBoxButtons.YesNo, MessageBoxIcon.Stop);
     }
 }
예제 #4
0
		private void dgDepartmentss_UserAddedRow(object sender, DataGridViewRowEventArgs e)
		{
			int id = Convert.ToInt32(departmentClient.CallSyncMethod("InsertDepartment", Guid.NewGuid().ToString()));

			var rowIndex = dgDepartments.Rows.IndexOf(e.Row);

			dgDepartments.Rows[rowIndex].Tag = id;
		}
예제 #5
0
        private void dgidGroup_UserAddedRow(object sender, DataGridViewRowEventArgs e)
        {
            var a = e.Row.DataBoundItem;
            if(a is ProductGroup)
            {

            }
        }
예제 #6
0
 private void dataGridView_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
 {
     e.Row.Cells["id"].Value = (Int64)DataBaseDriver.Instance.ProductsDataTable.Rows[DataBaseDriver.Instance.ProductsDataTable.Rows.Count - 1]["id"] + 1;
     e.Row.Cells["prime_cost"].Value = 0;
     e.Row.Cells["price"].Value = 0;
     e.Row.Cells["category_id"].Value = 1;
     e.Row.Cells["is_removed"].Value = 0;
 }
예제 #7
0
 protected override void OnUserDeletedRow(DataGridViewRowEventArgs e)
 {
     if (e.Row != null && mQueueDeleteEvents)
     {
         mDeletedRows++;
     }
     base.OnUserDeletedRow(e);
 }
예제 #8
0
 private void dtgUnidadesMedida_UserAddedRow(object sender, DataGridViewRowEventArgs e)
 {
     if (e.Row.IsNewRow)
     {
         ((List<UnitMeasureModel>)((BindingSource)dtgUnidadesMedida.DataSource).DataSource)[e.Row.Index - 1].Id = Guid.NewGuid();
         ((List<UnitMeasureModel>)((BindingSource)dtgUnidadesMedida.DataSource).DataSource)[e.Row.Index - 1].IsNewRegister = true;
     }
 }
예제 #9
0
 private void dtgTiposIdentificacion_UserAddedRow(object sender, DataGridViewRowEventArgs e)
 {
     if (e.Row.IsNewRow)
     {
         ((List<IdentificationTypeModel>)((BindingSource)dtgTiposIdentificacion.DataSource).DataSource)[e.Row.Index - 1].Id = Guid.NewGuid();
         ((List<IdentificationTypeModel>)((BindingSource)dtgTiposIdentificacion.DataSource).DataSource)[e.Row.Index - 1].IsNewRegister = true;
     }
 }
예제 #10
0
 private void dtgImpuestos_UserAddedRow(object sender, DataGridViewRowEventArgs e)
 {
     if (e.Row.IsNewRow)
     {
         ((List<TaxModel>)((BindingSource)dtgImpuestos.DataSource).DataSource)[e.Row.Index - 1].Id = Guid.NewGuid();
         ((List<TaxModel>)((BindingSource)dtgImpuestos.DataSource).DataSource)[e.Row.Index - 1].IsNewRegister = true;
     }
 }
예제 #11
0
파일: Form1.cs 프로젝트: SpaceCrab/gitRekt
 private void dgvPlayers_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
 {
     Player newPlayer = new Player()
     {
         Name = "Write name";
         Wins 
     }
 } 
 /// <summary>
 /// Metodo que llama a rellenar automaticamente los valores de una nueva fila.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DgvDocumentos_DefaultValuesNeeded(object sender,
                                                System.Windows.Forms.DataGridViewRowEventArgs e)
 {
     //Auto rellenar valores de texto
     if (!procesosAdministrador.NuevoRegistroDefault(e))
     {
         MessageBox.Show("Se ha presentado un error.");
     }
 }
예제 #13
0
 private void dataGridView2_UserAddedRow(object sender, DataGridViewRowEventArgs e)
 {
     if (dtgBXTrungGian.Rows.Count > 2)
         dtgBXTrungGian.AllowUserToAddRows = false;
     {
         dtgBXTrungGian.Rows[dtgBXTrungGian.RowCount - 1].Cells[0].Value = "";
         dtgBXTrungGian.Rows[dtgBXTrungGian.RowCount - 1].Cells[1].Value = "";
     }
 }
예제 #14
0
 //<Snippet120>
 private void dataGridView1_DefaultValuesNeeded(object sender,
                                                System.Windows.Forms.DataGridViewRowEventArgs e)
 {
     e.Row.Cells["Region"].Value     = "WA";
     e.Row.Cells["City"].Value       = "Redmond";
     e.Row.Cells["PostalCode"].Value = "98052-6399";
     e.Row.Cells["Country"].Value    = "USA";
     e.Row.Cells["CustomerID"].Value = NewCustomerId();
 }
 private void inventoryDataView_DefaultValuesNeeded(object sender, System.Windows.Forms.DataGridViewRowEventArgs e)
 {
     // this sets the default values for the items in the inventoryDataView, it acts as a railguard against items being sent back to the main form without all of their fields
     // this could also be done with different inventoryItem constructor combos, but the combinations could get out of hand
     e.Row.Cells["itemName"].Value     = "Default";
     e.Row.Cells["itemBrand"].Value    = "Default";
     e.Row.Cells["itemPrice"].Value    = 2.00;
     e.Row.Cells["itemCost"].Value     = 1.00;
     e.Row.Cells["itemQuantity"].Value = 1;
 }
예제 #16
0
 private void gridLineDataGridView1_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
 {
     // Default Enabled and Pass Execution Context to true
     //e.Row.Cells["Enabled"]
     //formEvent.Enabled = true;
     //formEvent.PassExecutionContext = true;
     e.Row.Cells[scriptDataGridViewTextBoxColumn.Name].Value = Scripts.Last().Name;
     e.Row.Cells[IsEnabled.Name].Value = true;
     e.Row.Cells[PassExecutionContext.Name].Value = true;
 }
예제 #17
0
        private void dataGridViewImages_UserDeletedRow(object sender, DataGridViewRowEventArgs e)
        {
            Validate();
            //signatureCounterDataSet1.Clear();
            tables.UpdateAll(signatureCounterDataSet1);
            tables.SignatureTableAdapter.Fill(signatureCounterDataSet1.Signature);

            ShowSignatureList();
            ShowSelectedImage();
            ShowTrimmingRectangle();
        }
 protected override void OnRowHeightChanged(DataGridViewRowEventArgs e)
 {
     // Bug 242.
     try
     {
         base.OnRowHeightChanged(e);
     }
     catch (InvalidOperationException)
     {
     }
 }
예제 #19
0
        private void dataG_UserDeletedRow(object sender, DataGridViewRowEventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("Вы действительно хотите удалить эту запись?", "Внимание!", MessageBoxButtons.YesNo);
            if (dialogResult == DialogResult.Yes)
            {
                string id = e.Row.Cells[0].Value.ToString();

                db.FetchAllSql("DELETE  FROM `regs`  WHERE id = '" + id + "'");

                loadit();
            }
        }
예제 #20
0
        private void dgv_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
        {
            int index = 1;
            if (_table != null)
            {
                object o = _table.Compute("MAX(順位)", null);
                if (o != DBNull.Value)
                    index = Convert.ToInt32(o) + 1;
            }

            e.Row.Cells[col順位.Index].Value = index;
            e.Row.Cells[col排序方式.Index].Value = "遞增";
        }
예제 #21
0
        private void dtgConfiguracion_UserAddedRow(object sender, DataGridViewRowEventArgs e)
        {
            if (e.Row.IsNewRow)
            {
                ((List<ConfigurationModel>)((BindingSource)dtgConfiguracion.DataSource).DataSource)[e.Row.Index - 1].Id = Guid.NewGuid();
                ((List<ConfigurationModel>)((BindingSource)dtgConfiguracion.DataSource).DataSource)[e.Row.Index - 1].IsNewRegister = true;

                dtgConfiguracion.Rows[e.Row.Index - 1].Cells["IdCurrency"].Value =
                    ((List<CurrencyTypeModel>)((DataGridViewComboBoxColumn)(dtgConfiguracion.Columns["CurrencyList"])).DataSource).FirstOrDefault().Id;
                dtgConfiguracion.Rows[e.Row.Index - 1].Cells["IdCountry"].Value =
                    ((List<CountryModel>)((DataGridViewComboBoxColumn)(dtgConfiguracion.Columns["CountryList"])).DataSource).FirstOrDefault().Id;
            }
        }
예제 #22
0
        private void dataGridView_Meus_Sigmas_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
        {
            // red
            e.Row.Cells[0].Value = 100;
            e.Row.Cells[1].Value = 1.5;

            // green
            e.Row.Cells[2].Value = 30;
            e.Row.Cells[3].Value = 0.9;

            // blue
            e.Row.Cells[4].Value = 20;
            e.Row.Cells[5].Value = 1.2;
        }
        internal void AddNewRow(bool createdByEditing)
        {
            Debug.Assert(this.Columns.Count > 0);
            Debug.Assert(this.newRowIndex == -1);

            this.Rows.AddInternal(true /*newRow*/, null /*values*/);
            this.newRowIndex = this.Rows.Count - 1;
            this.dataGridViewState1[DATAGRIDVIEWSTATE1_newRowCreatedByEditing] = createdByEditing;

            if (createdByEditing)
            {
                DataGridViewRowEventArgs dgvre = new DataGridViewRowEventArgs(this.Rows[this.newRowIndex]);
                OnUserAddedRow(dgvre);
            }
        }
        private void dgv_Common_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
        {
            e.Row.Cells["CreateDate"].Value = System.DateTime.Now;
            e.Row.Cells["ModifyDate"].Value = System.DateTime.Now;
            ZX.Win.FunctionParameter fp = new ZX.Win.FunctionParameter();
            fp = (ZX.Win.FunctionParameter)this.Tag;

                e.Row.Cells["ModifierName"].Value=fp.pub_sUserNameByChinese;

            if (e.Row.Cells["CreateName"].Value==null)
            {

                e.Row.Cells["CreateName"].Value = fp.pub_sUserNameByChinese;
            }
        }
예제 #25
0
        private void dtgCliente_UserAddedRow(object sender, DataGridViewRowEventArgs e)
        {
            if (e.Row.IsNewRow)
            {
                ((List<ClientModel>)((BindingSource)dtgCliente.DataSource).DataSource)[e.Row.Index - 1].Id = Guid.NewGuid();
                ((List<ClientModel>)((BindingSource)dtgCliente.DataSource).DataSource)[e.Row.Index - 1].DateEvent = DateTime.Now;

                if (((List<IdentificationTypeModel>)((DataGridViewComboBoxColumn)(dtgCliente.Columns["TypeList"])).DataSource).FirstOrDefault() != null)
                {
                    dtgCliente.Rows[e.Row.Index - 1].Cells["IdIdentificationType"].Value =
                        ((List<IdentificationTypeModel>)((DataGridViewComboBoxColumn)(dtgCliente.Columns["TypeList"])).DataSource).FirstOrDefault().Id;
                }
                else
                {
                    btnGuardar.Enabled = false;
                }
            }
        }
예제 #26
0
 private void DataGrid_DefaultValuesNeeded(object sender,
                                           System.Windows.Forms.DataGridViewRowEventArgs e)
 {
     e.Row.Cells["Checked"].Value = true;
 }
예제 #27
0
 private void dataGridTags_RowErrorTextChanged(object sender, DataGridViewRowEventArgs e)
 {
     this.labelDataGridError.Text = e.Row.ErrorText;
 }
        public void DataGridRowAddedHandler(object sender, DataGridViewRowEventArgs e)
        {
            ControlFactory factory = ControlFactory.Instance;
            Field field = factory.GetAssociatedField((Control)sender);
            if ((Control)sender is DataGridView)
            {
                DataGridView dataGridView = sender as DataGridView;

                if (dataGridView.DataSource is DataTable)
                {
                    DataTable dataTable = dataGridView.DataSource as DataTable;
                    if (dataTable.Rows.Count > 1)
                    {
                        view.Project.CollectedData.SaveGridRecord(view, int.Parse(this.view.UniqueKeyField.CurrentRecordValueString), (GridField)field, (DataTable)dataTable);
                    }
                }
                /**/
            }
        }
 private void dataGrid_UserAddedRow(object sender, DataGridViewRowEventArgs e)
 {
 }
예제 #30
0
        private void dgvRules_UserDeletedRow(object sender, DataGridViewRowEventArgs e)
        {
/*            var o2RulesDeleted = new List<IO2Rule>();
            if (e.Row.Tag != null && e.Row.Tag is IO2Rule)
                o2RulesDeleted.Add((IO2Rule)e.Row.Tag);
            deleteRules(o2RulesDeleted);*/
        }
예제 #31
0
 private void editorDataGridView_UserDeletedRow(object sender, DataGridViewRowEventArgs e)
 {
     m_changed = true;
 }
예제 #32
0
 private void editorDataGridView_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
 {
     e.Row.Cells[0].Value = e.Row.Index;
     e.Row.Cells[1].Value = string.Format("field{0}", e.Row.Index);
     e.Row.Cells[2].Value = "int";
     e.Row.Cells[4].Value = 1;
 }
예제 #33
0
 private void dgvStateChanges_UserDeletedRow(object sender, System.Windows.Forms.DataGridViewRowEventArgs e) => SaveChanges();
예제 #34
0
파일: Form1.cs 프로젝트: javieresos12/pro
 private void dataGridView1_DefaultValuesNeeded(object sender,
                                                System.Windows.Forms.DataGridViewRowEventArgs e)
 {
 }
 private void dataGridViewX1_UserDeletedRow(object sender, DataGridViewRowEventArgs e)
 {
     if (e.Row.IsNewRow) return;
     if (e.Row.Tag != null)
         this.deletedScores.Add((UDT.SubjectSemesterScore)e.Row.Tag);
 }
 /// <summary>
 /// Calling the serial no generation function
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvProduct_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
 {
     try
     {
         SerialNo();
     }
     catch (Exception ex)
     {
         MessageBox.Show("DN67:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 private void gridDiveProfil_UserDeletedRow(object sender, System.Windows.Forms.DataGridViewRowEventArgs e)
 {
     updateChartAndGridDiveProfile(true);
 }
예제 #38
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Called when a row in the grid changes heights. Make sure to adjust the
		/// FwTextBoxControls, if it's showing in the resized row in this column.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		void OnRowHeightChanged(object sender, DataGridViewRowEventArgs e)
		{
			var grid = sender as DataGridView;
			if (grid != null && grid.CurrentCell != null && grid.IsCurrentCellInEditMode &&
				grid.CurrentCellAddress.X == Index &&
				grid.CurrentCellAddress.Y == e.Row.Index)
			{
				TextBoxControl.Height = e.Row.Height;
			}
		}
예제 #39
0
 private void buildingsDataGridView_DefaultValuesNeeded(object sender, System.Windows.Forms.DataGridViewRowEventArgs e)
 {
     //e.Row.Cells["Name"].Value = "Factory";
     //e.Row.Cells["Cost"].Value = 10;
     //e.Row.Cells["Level"].Value = 1;
 }