public void NewSpecialMarkup(InitializingNewItemEventArgs e)
        {
            var markup = (MarkupConfig)e.NewItem;

            markup.Type    = MarkupType.Special;
            markup.Address = MarkupAddress.Value;
        }
Example #2
0
        private void sales_invoice_detailDataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            sales_invoice_detail sales_invoice_detail = (sales_invoice_detail)e.NewItem;
            sales_invoice        sales_invoice        = (sales_invoice)sales_invoiceDataGrid.SelectedItem;

            sales_invoice_detail.sales_invoice = sales_invoice;
        }
        public void NewVitallyImportantMarkup(InitializingNewItemEventArgs e)
        {
            var markup = (MarkupConfig)e.NewItem;

            markup.Type    = MarkupType.VitallyImportant;
            markup.Address = MarkupAddress.Value;
        }
Example #4
0
        private void sales_order_detailDataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            sales_order_detail sales_order_detail = (sales_order_detail)e.NewItem;
            sales_order        sales_order        = (sales_order)sales_orderDataGrid.SelectedItem;

            sales_order_detail.sales_order = sales_order;
        }
Example #5
0
        private void dataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            var dataRow  = ((System.Data.DataRowView)e.NewItem).Row;
            var database = (SQLInformation.Data.ApplicationDataSet.DatabasesRow)dataRow;

            database.ID = Guid.NewGuid();
        }
Example #6
0
        private void sales_return_detailDataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            sales_return_detail sales_return_detail = (sales_return_detail)e.NewItem;
            sales_return        sales_return        = (sales_return)sales_returnDataGrid.SelectedItem;

            sales_return_detail.sales_return = sales_return;
        }
 private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
 {
     if (e.NewItem is Model.Lists.ListItem item)
     {
         item.UpdateIndex(((DataGrid)sender).Items.Count - 2);
     }
 }
Example #8
0
        private void dgvContractDetail_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            decimal      coeficient   = 0;
            app_contract app_contract = null;

            if (app_contractViewSource.View.CurrentItem != null)
            {
                app_contract = app_contractViewSource.View.CurrentItem as entity.app_contract;
            }
            else
            {
                app_contract = myViewSource.View.CurrentItem as entity.app_contract;
            }
            foreach (var detail in app_contract.app_contract_detail.ToList())
            {
                coeficient += detail.coefficient;
            }
            app_contract_detail contract_detail = e.NewItem as app_contract_detail;

            if (coeficient != 0)
            {
                contract_detail.coefficient = 1 - coeficient;
            }
            else
            {
                contract_detail.coefficient = 1;
            }
        }
 private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
 {
     var p = e.NewItem as Project; if (p != null)
     {
         p.AddTime = DateTime.Now;
     }
 }
        private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            var b = e.NewItem as Beep;

            b.BeepDuration    = 1000;
            b.BeepFrequency   = 100;
            b.MsBeforeRinging = 1000;
        }
Example #11
0
 private void GridInitializingNewItem(object sender, InitializingNewItemEventArgs e)
 {
     if (e.NewItem is GridRow row && string.IsNullOrEmpty(row.Name))
     {
         // We don't have to add 1 because the count already includes this row.
         row.Name = $"Peer group {this.grid.ItemsSource.Cast<GridRow>().Count()}";
     }
 }
        private void dataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            Record newRecord = e.NewItem as Record;

            newRecord.FirstName = "Jesper";
            newRecord.LastName  = "Gulmann";
            newRecord.Website   = new Uri("http://www.wincubate.net");
            newRecord.Gender    = Gender.Male;
        }
Example #13
0
        private void EhInitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            var ev = InitializingNewRangeItem;

            if (null != ev)
            {
                ev(e.NewItem);
            }
        }
Example #14
0
        /// <summary>
        /// Méthode exécuté lors du lancement de l'évènement InitializingNewItem du dataGrid dgJoueur.
        /// Utilisé pour initialiser les champs avec des valeures par défault pour un nouveau objet du dataGrid.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgJoueur_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            //Par conception, le dataGrid contient uniquement des objets de type Joueur, il est donc possible de forcer le cast sans vérification.
            Joueur nvJoueur = (Joueur)e.NewItem;

            nvJoueur.Nom    = "NomJoueur";
            nvJoueur.Prenom = "PrénomJoueur";
            nvJoueur.NoDCI  = "#DCI";
        }
Example #15
0
 private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
 {
     /*
      * var icvs = ((CollectionViewSource)this.FindResource("uGSIconsViewSource"));
      * var dv = icvs.View;
      * var curi = (Icon)dv.CurrentItem;
      * curi.Shapes.Add(new Source.Icon.IconShape() { parent = curi });
      */
 }
 private void dataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
 {
     for (int i = 0; i < _attributeTypeSet.PredictiveAttributeTypes.Count; i++)
     {
         _items.Last()
         .PredictiveAttributeValues.Insert(i,
                                           new PredictiveAttributeValue(_attributeTypeSet.PredictiveAttributeTypes[i].Values.First(), false, false));
     }
     _items.Last().DecisiveAttributeValue = _attributeTypeSet.DecisiveAttributeType.Values.First();
 }
Example #17
0
 private void xgrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
 {
     if (EmployeeCmb.SelectedItem == null)
     {
         MessageBox.Show("Please Select Employee Above.");
         return;
     }
     ((DataLayer.PayrollEmployeeSetup)(e.NewItem)).EmployeeId = ((DataLayer.Employee)EmployeeCmb.SelectedItem).EmployeeId;
     ((DataLayer.PayrollEmployeeSetup)(e.NewItem)).StartDate  = DateTime.Now;
 }
Example #18
0
        private void dataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            //var itm = e.NewItem;
            //var dataRowView = (System.Data.DataRowView)itm;
            //var dataRow = dataRowView.Row;
            //var instance = (Data.ApplicationDataSet.InstancesRow)dataRow;

            ////Data.ApplicationDataSet.InstancesRow newRow = (Data.ApplicationDataSet.InstancesRow)((DataGridRow)e.NewItem).Row;
            //instance.ID = Guid.NewGuid();
        }
Example #19
0
 private void item_priceDataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
 {
     entity.item       item       = itemViewSource.View.CurrentItem as entity.item;
     entity.item_price item_price = e.NewItem as entity.item_price;
     if (item != null)
     {
         item_price.id_item = item.id_item;
         item_price.item    = item;
     }
 }
Example #20
0
        private void DataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            var          dg   = sender as DataGrid;
            PropertyInfo prop = e.NewItem.GetType().GetProperty("id", BindingFlags.Public | BindingFlags.Instance);

            if (null != prop && prop.CanWrite)
            {
                prop.SetValue(e.NewItem, dg.Items.Count - 2, null);
            }
        }
Example #21
0
        private void item_priceDataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            item       item       = itemDataGrid.SelectedItem as item;
            item_price item_price = e.NewItem as item_price;

            if (item != null)
            {
                item_price.id_item = item.id_item;
                item_price.item    = item;
            }
        }
Example #22
0
        private void DgComputers_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            Computer computer = e.NewItem as Computer;

            unitOfWork.ComputerRepository.Create(computer);
            if (dgProcessors.SelectedItem != null)
            {
                Processor selectedProcessor = dgProcessors.SelectedItem as Processor;
                computer.Processor = selectedProcessor;
            }
        }
Example #23
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgIncomeCustomer_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            FinancialIncome obj = e.NewItem as FinancialIncome;

            if (obj != null)
            {
                NewFinancialIncomeList.Add(obj);
                obj.ProductID = SelectedProduct.ProductID;
                UpdateLabels();
            }
        }
        private void dgDetails_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            var detail = e.NewItem as ScheduleDetailsController;

            if (detail != null)
            {
                if (detail.ContractNo == 0)
                {
                    ((AddSchedulDetailsController)_controller).SetContractNo(detail);
                }
            }
        }
        private void DataGrid_InitializingNewItem_1(object sender, InitializingNewItemEventArgs e)
        {
            //if (BaseViewModel.Instance.CurrentTariffCategory != null)
            //{
            //    ((TariffSupUnitLkps)(e.NewItem)).TariffCategoryCode = BaseViewModel.Instance.CurrentTariffCategory.TariffCategoryCode;
            //}
            //else
            //{
            //    MessageBox.Show("Please select a tariff Category Code");

            //}
        }
Example #26
0
 private void InfoGrid_OnInitializingNewItem(object sender, InitializingNewItemEventArgs e)
 {
     if (sender is DataGrid dataGrid && dataGrid.Items.Count > 1)
     {
         if (dataGrid.Items.CurrentItem is Student student)
         {
             // Setting initial information - 'groupId' and 'phoneNumber'.
             student.GroupId     = (dataGrid.Items[0] as Student).GroupId;
             student.PhoneNumber = "+380";
         }
     }
 }
Example #27
0
        private void dataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            List <ExamineExamplesDataGridItem> items = new List <ExamineExamplesDataGridItem>(dataGrid.ItemsSource.Cast <ExamineExamplesDataGridItem>());

            items.Last().PredictiveAttributeValues = new List <string>();
            for (int i = 0; i < _attributeTypeSet.PredictiveAttributeTypes.Count; i++)
            {
                items.Last().PredictiveAttributeValues.Insert(i, string.Empty);
            }
            items.Last().DecisiveAttributeValue = string.Empty;
            items.Last().ExaminedAttributeValue = string.Empty;
        }
Example #28
0
        private void dgvPaymentDetail_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            sales_invoice  sales_invoice  = sales_invoiceViewSource.View.CurrentItem as sales_invoice;
            payment        payment        = paymentViewSource.View.CurrentItem as payment;
            payment_detail payment_detail = e.NewItem as payment_detail;

            payment_detail.State         = EntityState.Added;
            payment_detail.IsSelected    = true;
            payment_detail.id_currencyfx = sales_invoice.id_currencyfx;
            payment_detail.id_currency   = sales_invoice.app_currencyfx.id_currency;

            payment_detail.id_payment = payment.id_payment;
            payment_detail.payment    = payment;
        }
        private void dataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            //for (int i = 0; i < _attributeTypeSet.PredictiveAttributeTypes.Count; i++)
            //{
            //    _items.Last().PredictiveAttributeValues.Insert(i, string.Empty);
            //}
            //_items.Last().DecisiveAttributeValue = string.Empty;

            for (int i = 0; i < _attributeTypeSet.PredictiveAttributeTypes.Count; i++)
            {
                _items.Last().PredictiveAttributeValues.Insert(i, _attributeTypeSet.PredictiveAttributeTypes[i].Values.First());
            }
            _items.Last().DecisiveAttributeValue = _attributeTypeSet.DecisiveAttributeType.Values.First();
        }
Example #30
0
        private void serversDataGrid_InitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            //var itm = e.NewItem;
            //var dataRowView = (System.Data.DataRowView)itm;
            //var dataRowView = (System.Data.DataRowView)e.NewItem;

            //var dataRow = dataRowView.Row;

            //var server = (Data.ApplicationDataSet.ServersRow)dataRowView.Row;
            var server = (SQLInformation.Data.ApplicationDataSet.ServersRow)((System.Data.DataRowView)e.NewItem).Row;

            //Data.ApplicationDataSet.InstancesRow newRow = (Data.ApplicationDataSet.InstancesRow)((DataGridRow)e.NewItem).Row;
            server.ID = Guid.NewGuid();
        }
Example #31
0
        private object AddNewItem()
        {
            Debug.Assert(CanUserAddRows, "AddNewItem called when the end-user cannot add new rows.");
            Debug.Assert(!IsAddingNewItem, "AddNewItem called when a pending add is taking place.");

            // Hide the placeholder
            UpdateNewItemPlaceholder(/* isAddingNewItem = */ true);

            object newItem = EditableItems.AddNew();
            if (newItem != null)
            {
                InitializingNewItemEventArgs e = new InitializingNewItemEventArgs(newItem);
                OnInitializingNewItem(e);
            }

            // CancelEdit and CommitEdit rely on IsAddingNewItem
            CommandManager.InvalidateRequerySuggested();

            return newItem;
        }
Example #32
0
 /// <summary>
 ///     A method that is called when a new item is created so that
 ///     overrides can initialize the item with custom default values.
 /// </summary>
 /// <remarks>
 ///     The default implementation raises the InitializingNewItem event.
 /// </remarks>
 /// <param name="e">Event arguments that provide access to the new item.</param>
 protected virtual void OnInitializingNewItem(InitializingNewItemEventArgs e)
 {
     if (InitializingNewItem != null)
     {
         InitializingNewItem(this, e);
     }
 }