/// <summary>
 /// 編集中に DataGrid の IsReadOnly プロパティを利用すると変更がキャンセルされる為、編集開始時に DataGridEditManager クラスの IsEdit プロパティを確認し、編集開始を実行するかキャンセルするかを判断します。
 /// </summary>
 /// <param name="sender">編集する DataGrid</param>
 /// <param name="e">PreparingCellForEdit イベント引数</param>
 private void OnPreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
 {
     if (this.IsEditing == false)
     {
         this.Source.IsReadOnly = true;
     }
 }
        private void DataGrid_PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
        {
            var ec = ExtensionServices.GetVisualChild<TextBox>(e.EditingElement as ContentPresenter);
            if (ec != null) ec.SelectAll();

            var cb = ExtensionServices.GetVisualChild<ComboBox>(e.EditingElement as ContentPresenter);
            if (cb != null) cb.Focus();
        }
예제 #3
0
 void dgScriptData_PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
 {
     //if (e.Column == colStateCandiate)
     //{
     //    DataGridCell cell = e.Column.GetCellContent(e.Row).Parent as DataGridCell;
     //    cell.IsEnabled = (e.Row.Item as Model).StateCandidates != null;
     //}
 }
예제 #4
0
        private void RaisePreparingCellForEdit(RoutedEventArgs editingEventArgs)
        {
            DataGrid dataGridOwner = DataGridOwner;

            if (dataGridOwner != null)
            {
                FrameworkElement currentEditingElement = EditingElement;
                DataGridPreparingCellForEditEventArgs preparingCellForEditEventArgs = new DataGridPreparingCellForEditEventArgs(Column, RowOwner, editingEventArgs, currentEditingElement);
                dataGridOwner.OnPreparingCellForEdit(preparingCellForEditEventArgs);
            }
        }
        // Token: 0x060046FC RID: 18172 RVA: 0x00141FF4 File Offset: 0x001401F4
        private void RaisePreparingCellForEdit(RoutedEventArgs editingEventArgs)
        {
            DataGrid dataGridOwner = this.DataGridOwner;

            if (dataGridOwner != null)
            {
                FrameworkElement editingElement         = this.EditingElement;
                DataGridPreparingCellForEditEventArgs e = new DataGridPreparingCellForEditEventArgs(this.Column, this.RowOwner, editingEventArgs, editingElement);
                dataGridOwner.OnPreparingCellForEdit(e);
            }
        }
예제 #6
0
        private void OnPreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
        {
            var editingArea = e.EditingElement as TextBox;

            if (editingArea != null)
            {
                if (string.IsNullOrEmpty(editingArea.Text.Trim()))
                {
                    editingArea.Text = "";
                }
            }
        }
        /// <summary>
        /// valida la celda
        /// </summary>
        /// <history>
        /// [vipacheco] 29/Julio/2016 Created
        /// </history>
        private void grdDeposits_PreparingCellForEdit(object sender, System.Windows.Controls.DataGridPreparingCellForEditEventArgs e)
        {
            DataGrid        dataGrid        = sender as DataGrid;
            DepositToRefund selectedDeposit = dataGrid.Items.CurrentItem as DepositToRefund;

            _currentCell = grdDeposits.CurrentCell;

            switch (_currentCell.Column.SortMemberPath)
            {
            case "bdRefund":
                if ((bool)selectedDeposit.bdRefund)
                {
                    _currentCell.Column.IsReadOnly = true;
                }
                break;
            }
        }
 private void dgvEmployeeCards_PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
 {
     using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "dgvEmployeeCards_PreparingCellForEdit"))
     {
         try
         {
             MainConfigurationViewModel vm = this.DataContext as MainConfigurationViewModel;
             if (vm != null)
             {
                 ComboBox cmbEditingElement = e.EditingElement as ComboBox;
                 if (cmbEditingElement != null)
                 {
                     BindingOperations.SetBinding(cmbEditingElement, ComboBox.ItemsSourceProperty,
                         new Binding() { Source = vm.GIMInformationsForCard });
                 }
             }
         }
         catch (Exception ex)
         {
             method.Exception(ex);
         }
     }
 }
예제 #9
0
 private void CellChangingStarted(object sender, DataGridPreparingCellForEditEventArgs dataGridCellEditEndingEventArgs)
 {
     lock (_objForLock)
     {
         _isCellChangingStarted = true;
     }
 }
예제 #10
0
        /// <summary>
        /// This PreparingCellForEdit event handler gets the hosted editing ComboBox control
        /// and bind its ItemsSource property according to the value of the Country.
        /// </summary>             
        private void datagrid_PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
        {
            if (e.Column.Header.Equals("City"))
            {
                ComboBox cmbEditingElement = e.EditingElement as ComboBox;
                if ((e.Row.Item as DataRowView)["Country"].Equals("China"))
                {

                    // Bind the ItemsSource property of the cmbEditingElement to China cities
                    // string array if the selected country is China.
                    BindingOperations.SetBinding(cmbEditingElement, ComboBox.ItemsSourceProperty,
                        new Binding() { Source = strChinaCities });
                }
                else if ((e.Row.Item as DataRowView)["Country"].Equals("UnitedStates"))
                {

                    // Bind the ItemsSource property of the cmbEditingElement to United State
                    // cities string array if the selected country is United State.
                    BindingOperations.SetBinding(cmbEditingElement, ComboBox.ItemsSourceProperty,
                        new Binding() { Source = strUnitedStateCities });
                }
            }
        }
 private void PreparingCellForEditClerkGrid(object sender, DataGridPreparingCellForEditEventArgs e)
 {
     var row = e.Row.DataContext;
     ComboBox cmb = this.RGReportDataGridClerk.Columns[14].GetCellContent(e.Row) as ComboBox;
     if (cmb != null)
         if (((RGReportRow)row).RemarkText == "RETAKE")
             cmb.IsEnabled = true;
         else
         {
             cmb.IsEnabled = false;
             cmb.SelectedIndex = -1;
         }
 }
        /// <summary>
        /// Raises the PreparingCellForEdit event.
        /// </summary>
        protected virtual void OnPreparingCellForEdit(DataGridPreparingCellForEditEventArgs e)
        {
            EventHandler<DataGridPreparingCellForEditEventArgs> handler = this.PreparingCellForEdit;
            if (handler != null)
            {
                handler(this, e);
            }

            // Raise the automation invoke event for the cell that just began edit because now
            // its editable content has been loaded
            DataGridAutomationPeer peer = DataGridAutomationPeer.FromElement(this) as DataGridAutomationPeer;
            if (peer != null && AutomationPeer.ListenerExists(AutomationEvents.InvokePatternOnInvoked))
            {
                peer.RaiseAutomationInvokeEvents(DataGridEditingUnit.Cell, e.Column, e.Row);
            }
        }
 private void DataGrid_PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
 {
 }
예제 #14
0
 private void preparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
 {
     if (e.EditingElement is TextBox)
     {
         currentTextBox = (TextBox)e.EditingElement;
         currentTextBox.AutoWordSelection = false;
     }
 }
예제 #15
0
 public void checkEmptyRow(object sender, DataGridPreparingCellForEditEventArgs args)
 {
     if (args.Row.GetIndex() == (_dgrid.Items.Count - 1))
     {
         XmlElement node = this.xmlNode.OwnerDocument.CreateElement(_el.Name);
         XmlDocument doc = XmlSchemaUtilities.generateCleanXmlToString(xsdNode.SourceUri);
         XmlNode samplenode = doc.DocumentElement.SelectSingleNode("//" + _el.Name);
         node.InnerXml = samplenode.InnerXml;
         xmlNode.AppendChild(node);
         hasPendingChanges();
     }
 }
 protected internal virtual new void OnPreparingCellForEdit(DataGridPreparingCellForEditEventArgs e)
 {
 }
예제 #17
0
파일: DataGrid.cs 프로젝트: JianwenSun/cc
 /// <summary>
 ///     Called after a cell has changed to editing mode to allow
 ///     subclasses to modify the contents of the cell.
 /// </summary>
 /// <remarks>
 ///     Default implementation raises the PreparingCellForEdit event.
 ///     This method is invoked from DataGridCell (instead of DataGrid) once it has entered edit mode.
 /// </remarks>
 protected internal virtual void OnPreparingCellForEdit(DataGridPreparingCellForEditEventArgs e)
 {
     if (PreparingCellForEdit != null)
     {
         PreparingCellForEdit(this, e);
     }
 }
예제 #18
0
 private void dgLottery_PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
 {
     currentEditionName = (e.Row.DataContext as LotteryInfo).LotteryName;
 }
예제 #19
0
        private void dtGridRoute_PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
        {
            if (e.Column.DisplayIndex == 0)
            {

                CheckBox chBox = e.EditingElement as CheckBox;
                if ((bool)chBox.IsChecked)
                {

                    checkBoxMapSource.IsChecked = false;
                    checkBoxMapTarget.IsChecked = false;
                    //   buttonClear.Visibility = System.Windows.Visibility.Visible;
                    int selind = dtGridRoute.SelectedIndex;

                    for (int i = 0; i < dtGridRoute.Items.Count; i++)
                    {
                        OsmRouteData DetailData = ((List<OsmRouteData>)dtGridRoute.ItemsSource)[i];
                        if (i != selind)
                        {
                            DetailData.IsMapClick = false;
                        }
                    }
                }
                dtGridRoute.CommitEdit(DataGridEditingUnit.Cell, true);
            }

        }
예제 #20
0
 private void dgPlayType_PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
 {
     currentEditionName = (e.Row.DataContext as PlayTypeInfo).PlayTypeName;
 }
예제 #21
0
 protected override void OnPreparingCellForEdit(DataGridPreparingCellForEditEventArgs e)
 {
     Log.DebugFormat("OnPreparingCellForEdit(Row.Item.Type = {0})", e.Row.Item.GetType().Name);
     Log.DebugFormat("    continueEdit={0}, isNewItem={1}", continueEdit, isNewItemForContinueEdit);
     base.OnPreparingCellForEdit(e);
     var editor = e.EditingElement.FindVisualChild<PropertyEditor>();
     if (editor != null)
     {
         editor.Focus();
     }
 }
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Controls.DataGrid.PreparingCellForEdit"/> event.
        /// </summary>
        /// <param name="e">The event data.</param>
        protected override void OnPreparingCellForEdit(DataGridPreparingCellForEditEventArgs e)
        {
            base.OnPreparingCellForEdit(e);

            FrameworkElement frameworkElement = e.Column.GetCellContent(e.Row);
            Field associatedField = e.Column.GetValue(FieldColumnProperty) as Field;
            if (associatedField != null)
            {
                string columnHeader = associatedField.Name;
                DatePicker datePicker = frameworkElement as DatePicker;

                if (datePicker != null)
                {
                    columnForCellBeingEdited = columnHeader;
                    datePickerDataContext = datePicker.DataContext;
                    datePicker.SelectedDateChanged += DatePicker_SelectedDateChanged;
                }
            }
        }
 protected internal virtual new void OnPreparingCellForEdit(DataGridPreparingCellForEditEventArgs e)
 {
 }
예제 #24
0
 private void DataGridOnPreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
 {
     _cellEditingMode = true;
 }
예제 #25
0
 private void dgEstimate_PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
 {
     switch (e.Column.DisplayIndex)
     {
         case 0:
             (e.EditingElement as TextBox).SetValue(InputMethod.PreferredImeConversionModeProperty, ImeConversionModeValues.FullShape);
             (e.EditingElement as TextBox).SetValue(InputMethod.PreferredImeStateProperty, InputMethodState.On);
             break;
         case 2:
         case 4:
         case 5:
         case 6:
         case 8:
             (e.EditingElement as TextBox).SetValue(InputMethod.IsInputMethodEnabledProperty, true);
             (e.EditingElement as TextBox).SetValue(InputMethod.PreferredImeConversionModeProperty, ImeConversionModeValues.Alphanumeric);
             (e.EditingElement as TextBox).SetValue(InputMethod.PreferredImeStateProperty, InputMethodState.On);
             break;
     }
 }
예제 #26
0
 private void RaisePreparingCellForEdit(RoutedEventArgs editingEventArgs)
 {
     DataGrid dataGridOwner = DataGridOwner;
     if (dataGridOwner != null)
     {
         FrameworkElement currentEditingElement = EditingElement;
         DataGridPreparingCellForEditEventArgs preparingCellForEditEventArgs = new DataGridPreparingCellForEditEventArgs(Column, RowOwner, editingEventArgs, currentEditingElement);
         dataGridOwner.OnPreparingCellForEdit(preparingCellForEditEventArgs);
     }
 }
 void PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
 {
     TableColumn c = e.Row.DataContext as TableColumn;
     if (e.Column.DisplayIndex == 2)
     {
         if (TableDataType.IsLengthFixed(c.DataType))
         {
             TextBox textBox = (e.EditingElement as TextBox);
             textBox.IsReadOnly = true;
         }
         else
         {
             TextBox textBox = (e.EditingElement as TextBox);
             textBox.IsReadOnly = false;
         }
     }
     if (e.Column.DisplayIndex == 3)
     {
         if (TableDataType.IsNullFixed(c.DataType))
         {
             CheckBox checkBox = (e.EditingElement as CheckBox);
             checkBox.IsEnabled = false;
             checkBox.IsChecked = false;
         }
         else
         {
             CheckBox checkBox = (e.EditingElement as CheckBox);
             checkBox.IsEnabled = true;
             checkBox.IsChecked = false;
         }
     }
 }
예제 #28
0
 private void FileList_PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
 {
     FileList.IsReadOnly = true;
 }