示例#1
0
        private void DataGrid_CellEditEnding(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
        {
            IsChanged = true;
            var rowView = e.Row.DataContext as DataRowView;

            IdsToUpdate.Add(rowView.Row.ItemArray[0].ToString());
        }
        private void DataGrid_OnVM(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
        {
            var terminal = (Terminal)((System.Windows.Controls.DataGrid)sender).CurrentCell.Item;
            var newValue = ((System.Windows.Controls.TextBox)e.EditingElement).Text;

            if (terminal != null)
            {
                new Helper().UpdateTerminalAdress(terminal.Id, newValue);
            }
        }
示例#3
0
 //
 //提交单元格 的更改到类
 //
 private void dgv_TemplateInfo_CellEditEnding(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
 {
     if (e.EditAction == System.Windows.Controls.DataGridEditAction.Commit)
     {
         int i = e.Row.GetIndex();                                         //Get Rows Index 获取行号索引
         Maticsoft.Model.LabInfo li = (Maticsoft.Model.LabInfo)e.Row.Item; // Convert to LabInfo  转换为LabInfo类型
         _WTT_LabInfo[i] = li;                                             // Assignment _WTT     修改全局变量
         My_MessageBox.My_MessageBox_Message(li.ToString());               //MessageShow   显示信息
     }
 }
示例#4
0
        private void dataGridSymbols_CellEditEnding(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
        {
            var symbol  = e.EditingElement.DataContext as Symbol;
            var textBox = e.EditingElement as System.Windows.Controls.TextBox;

            if (symbol == null || textBox == null || e.Column.DisplayIndex != 0 || symbol.Name == textBox.Text)
            {
                return;
            }

            _viewModel.ReplaceSymbolName(symbol.Name, textBox.Text);
        }
示例#5
0
 private void infoGrid_CellEditEnding(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
 {
     using (StreamWriter file = File.AppendText(@"log.txt"))
     {
         if ((infoGrid.SelectedItems[0] as DataRowView).Row.ItemArray.GetValue(0).ToString() != "")
         {
             file.WriteLine($"({DateTime.Now}) row({(infoGrid.SelectedItems[0] as DataRowView).Row.ItemArray.GetValue(0).ToString()}) edited");
         }
         else
         {
             file.WriteLine($"({DateTime.Now}) new row created");
         }
     }
 }
示例#6
0
        private void Table_CellEditEnding(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
        {
            var el = e.EditingElement.DataContext as Notification;

            try
            {
                using (AppContext db = new AppContext())
                {
                    Notification change = db.Notifications.Where(x => x.Message == el.Message).FirstOrDefault();
                    change.IsEnabled = !el.IsEnabled;
                    db.SaveChanges();
                }
            }
            catch (SqlException ex)
            {
                Logger.Error($"Database connection is not available {ex}");
            }
        }
        /// <summary>
        /// Обновление атрибута объекта
        /// </summary>
        public void UpdateObjectAttribute(object parameter = null)
        {
            var commEvtParam = parameter as CommandEventParameter;

            if (commEvtParam != null)
            {
                if (this.SelectedItems.Count > 0)
                {
                    System.Windows.Controls.DataGridCellEditEndingEventArgs e = commEvtParam.EventArgs as System.Windows.Controls.DataGridCellEditEndingEventArgs;
                    String labelValue = (e.EditingElement as System.Windows.Controls.TextBox).Text;
                    int    objectId   = Convert.ToInt32(this.SelectedItems[this.SelectedItems.Count - 1].Row.ItemArray[0]);
                    _mvLayer.getObject(objectId).SetAttribute("label", labelValue);
                    _mvLayer.RemoveDeletedObjects();
                    _mvLayer.Update();
                    _axMapLib.mapRepaint();
                }
            }
        }
        private void infoGrid_CellEditEnding(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
        {
            try
            {
                switch (curTable)
                {
                case "team":
                    var team = infoGrid.SelectedItem as Team;
                    if (team.id != 0)
                    {
                        var    t        = e.EditingElement as System.Windows.Controls.TextBox;
                        string col      = infoGrid.CurrentCell.Column.Header.ToString();
                        string new_data = t.Text;
                        dal.updateTeam(team, col, new_data);
                    }
                    infoGrid.ItemsSource = dal.showTeams();
                    break;

                case "player":
                    var player = infoGrid.SelectedItem as Player;
                    if (player.id != 0)
                    {
                        var    t        = e.EditingElement as System.Windows.Controls.TextBox;
                        string col      = infoGrid.CurrentCell.Column.Header.ToString();
                        string new_data = t.Text;
                        dal.updatePlayer(player, col, new_data);
                    }

                    infoGrid.ItemsSource = dal.showPlayers();

                    break;

                default:
                    MessageBox.Show("Wrong table selected");
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#9
0
 private void dgTransactionDetails_CellEditEnding(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
 {
     try
     {
         if (e.Column.DisplayIndex == 0) //.Header.ToString() == "Member Code")
         {
             var x = (CashVoucher)e.Row.Item;
             var y = ((System.Windows.Controls.TextBox)e.EditingElement).Text;
             x.MemberCode = y;
         }
         if (e.Column.DisplayIndex == 2) //.Header.ToString() == "Account Code")
         {
             var x = (CashVoucher)e.Row.Item;
             var y = ((System.Windows.Controls.TextBox)e.EditingElement).Text;
             x.AccountCode = y;
         }
         if (e.Column.Header.ToString() == "Debit")
         {
             var     x = (CashVoucher)e.Row.Item;
             var     y = ((System.Windows.Controls.TextBox)e.EditingElement).Text;
             decimal amount;
             Decimal.TryParse(y, out amount);
             x.Debit = amount;
         }
         if (e.Column.Header.ToString() == "Credit")
         {
             var     x = (CashVoucher)e.Row.Item;
             var     y = ((System.Windows.Controls.TextBox)e.EditingElement).Text;
             decimal amount;
             Decimal.TryParse(y, out amount);
             x.Credit = amount;
         }
     }
     catch (Exception exception)
     {
         MessageWindow.ShowAlertMessage(exception.Message);
     }
 }
 private void dGconfigPumpenEdit_click(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
 {
 }
 private void dGconfigRioKaesten_CellEditEnding(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
 {
     writeRioConfig();
 }
 private void dGconfigPaKaestenEdit_click(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
 {
     //Daten schreiben
     writePAConfig();
 }
 private void dGconfigGeräteEdit_click(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
 {
     //Daten schreiben
     writeMSRGeräteConfigToXml(loadFileGeräteConfig, dGconfigGeräte.DataContext);
 }
示例#14
0
 private void teachersDG_CellEditEnding(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
 {
 }
 private void CellEditEnding(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
 {
     isBeingEdited = false;
 }