コード例 #1
0
 /// <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;
     }
 }
コード例 #2
0
        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);
            }
        }
コード例 #5
0
        // 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 = "";
                }
            }
        }
コード例 #7
0
        /// <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;
            }
        }
コード例 #8
0
 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 });
                }
            }
        }
コード例 #11
0
 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;
         }
 }
コード例 #12
0
        /// <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);
            }
        }
コード例 #13
0
 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
ファイル: DocUIDataGrid.cs プロジェクト: 00Green27/DocUI
 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();
     }
 }
コード例 #16
0
 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
ファイル: ZetboxDataGrid.cs プロジェクト: daszat/zetbox
 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();
     }
 }
コード例 #22
0
        /// <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;
                }
            }
        }
コード例 #23
0
 protected internal virtual new void OnPreparingCellForEdit(DataGridPreparingCellForEditEventArgs e)
 {
 }
コード例 #24
0
 private void DataGridOnPreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
 {
     _cellEditingMode = true;
 }
コード例 #25
0
ファイル: UIEstimate.xaml.cs プロジェクト: sajidk/Estimate-SL
 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);
     }
 }
コード例 #27
0
 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
ファイル: MainWindow.xaml.cs プロジェクト: graou13/STZGTMP
 private void FileList_PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
 {
     FileList.IsReadOnly = true;
 }