Exemplo n.º 1
0
 /// <summary>
 /// Handler cancels editing object.
 /// </summary>
 /// <param name="sender">Data grid control sender.</param>
 /// <param name="e">Item event erags.</param>
 private void _DataGridCollectionViewSourceCancelingEdit(object sender,
                                                         DataGridItemHandledEventArgs e)
 {
     e.Handled           = true;
     IsEditingInProgress = false;
     _SetSelectionStatus(((ICollection <Barrier>)e.CollectionView.SourceCollection).Count);
 }
        /// <summary>
        /// React on cancelling edit.
        /// </summary>
        /// <param name="sender">Ignored.</param>
        /// <param name="e">Event args.</param>
        private void _CancelingEdit(object sender, DataGridItemHandledEventArgs e)
        {
            _geocodablePage.OnEditCanceled(e);
            e.Handled = true;

            CurrentItem.Address.PropertyChanged -= new PropertyChangedEventHandler(_AddressPropertyChanged);
            CurrentItem.PropertyChanged         -= new PropertyChangedEventHandler(_CurrentItemPropertyChanged);
        }
 private void DataGridCollectionViewSource_CancelingNewItem(object sender, DataGridItemHandledEventArgs e)
 {
     // set property to true if new item was created or to false if new item wasn't created
     // otherwise an InvalidOperationException will be thrown (see http://doc.xceedsoft.com/products/XceedWpfDataGrid/Inserting_Data.html)
     e.Handled           = _isNewItemCreated;
     IsEditingInProgress = false;
     _SetSelectionStatus();
 }
        /// <summary>
        /// Cancel creating new item.
        /// </summary>
        public void CancellingNewItem(DataGridItemHandledEventArgs e)
        {
            _geocodablePage.OnNewItemCancelling();

            string status = string.Format((string)App.Current.FindResource(OptimizeAndEditPage.NoSelectionStatusFormat),
                                          _currentSchedule.Routes.Count, _currentSchedule.UnassignedOrders.Count);

            App.Current.MainWindow.StatusBar.SetStatus(_parentPage, status);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Edit canceled.
 /// </summary>
 /// <param name="sender">Ignored.</param>
 /// <param name="e">Ignored.</param>
 private void _DataGridCollectionViewSourceCancelingEdit(object sender, DataGridItemHandledEventArgs e)
 {
     e.Handled           = true;
     IsEditingInProgress = false;
     if (EditFinished != null)
     {
         EditFinished(this, null);
     }
     _SetSelectionStatus();
 }
Exemplo n.º 6
0
        /// <summary>
        /// Handler for the Xceed.Wpf.DataGrid.DataGridCollectionViewSource.CancelingNewItem event.
        /// </summary>
        /// <param name="sender">DataGridCollectionViewSource object.</param>
        /// <param name="e">Event arguments.</param>
        private void _DataGridCollectionViewSourceCancelingNewItem(object sender, DataGridItemHandledEventArgs e)
        {
            _isEdititngInProgress = false;

            // Make the "Delete" button disabled.
            _buttonDelete.IsEnabled = false;

            // Manually handling the insertion of new items requires that the CreatingNewItem,
            // CommitingNewItem, and CancelingNewItem events must all be handled even if nothing
            // is done in the event.
            // Set property to true otherwise an InvalidOperationException will be thrown
            // (see http://doc.xceedsoft.com/products/XceedWpfDataGrid/Inserting_Data.html).
            e.Handled = true;
        }
Exemplo n.º 7
0
        /// <summary>
        /// React on new item committed.
        /// </summary>
        public void CancellingNewItem(DataGridItemHandledEventArgs e)
        {
            Debug.Assert(_mapControl.EditedObject is Route);

            _mapControl.EditEnded();

            _addedRoute = null;

            string status = string.Format((string)App.Current.FindResource(OptimizeAndEditPage.NoSelectionStatusFormat),
                                          _parentPage.CurrentSchedule.Routes.Count,
                                          _parentPage.CurrentSchedule.UnassignedOrders.Count);

            App.Current.MainWindow.StatusBar.SetStatus(_parentPage, status);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Raises event about new item is cancelling.
        /// </summary>
        /// <param name="sender">Data grid control sender.</param>
        /// <param name="e">Item event args.</param>
        private void _DataGridCollectionViewSourceCancelingNewItem(object sender, DataGridItemHandledEventArgs e)
        {
            // Set property to true if new item was created or to false if new item wasn't created.
            // Otherwise an InvalidOperationException will be thrown (see http://doc.xceedsoft.com/products/XceedWpfDataGrid/Inserting_Data.html).
            e.Handled = _isNewItemCreated;
            _handler.CancellingNewItem(e);

            // NOTE : workaround - hide cell editors when new item's cancelling.
            if (_ordersInsertionRow != null)
            {
                _ordersInsertionRow.CellEditorDisplayConditions = CellEditorDisplayConditions.None;
            }

            _isNewItemCreated = false;
        }
        private void DataGridCollectionViewSource_CancelingEdit(object sender, DataGridItemHandledEventArgs e)
        {
            if (!_isForcingEndEdit)
            {
                App.Current.MainWindow.StatusBar.SetStatus(this, null);
            }
            _isForcingEndEdit = false;

            Row parentRow = (Row)XceedGrid.GetContainerFromItem(e.Item);

            parentRow.Cells[IS_CURRENT_COLUMN_CAPTION].IsEnabled = true;

            _projectNameBeforeEditing = string.Empty;

            e.Handled = true;
        }
Exemplo n.º 10
0
        /// <summary>
        /// React on cancelling new item.
        /// </summary>
        /// <param name="e">Cancelling item event args.</param>
        public void OnNewItemCancelling(DataGridItemHandledEventArgs e)
        {
            // Supporting API issues. Needed in case of external new item creating canceling.
            if (!_isInEditedMode)
            {
                return;
            }

            _canceledByGrid = true;
            ObjectLayer.DeleteObject(_currentItem, _parentLayer.MapLayer);
            _EditEnded(false);
            e.Handled       = true;
            _canceledByGrid = false;

            _SetToolsEnabled(false);

            _currentItem = null;
        }
Exemplo n.º 11
0
        /// <summary>
        /// React on cancelling edit.
        /// </summary>
        /// <param name="sender">Ignored.</param>
        /// <param name="e">Event args.</param>
        private void _CancelingEdit(object sender, DataGridItemHandledEventArgs e)
        {
            _geocodablePage.OnEditCanceled(e);
            e.Handled = true;

            // If item was cancelled - move location to fake position.
            Location canceledLocation = e.Item as Location;

            if (string.IsNullOrEmpty(canceledLocation.Name))
            {
                canceledLocation.GeoLocation         = new ESRI.ArcLogistics.Geometry.Point(0, 0);
                canceledLocation.Address.FullAddress = string.Empty;
            }

            if (CurrentItem != null)
            {
                CurrentItem.Address.PropertyChanged -= new PropertyChangedEventHandler(_AddressPropertyChanged);
                CurrentItem.PropertyChanged         -= new PropertyChangedEventHandler(_CurrentItemPropertyChanged);
            }
            else
            {
                // Do nothing. Current item is null after cancelling.
            }
        }
Exemplo n.º 12
0
 private void CollectionView_CancellingNewItem(object sender, DataGridItemHandledEventArgs e)
 {
     e.Handled = true;
 }
 /// <summary>
 /// React on editing cancelled in grid.
 /// </summary>
 /// <param name="sender">Ignored.</param>
 /// <param name="e">Cancelling edit param args.</param>
 private void _DataGridCancelingEdit(object sender, DataGridItemHandledEventArgs e)
 {
     e.Handled = true;
 }
Exemplo n.º 14
0
 private void DataGridCollectionViewSource_CancelingNewItem(object sender, DataGridItemHandledEventArgs e)
 {
     App.Current.MainWindow.StatusBar.SetStatus(this, null);
     e.Handled = true;
 }
Exemplo n.º 15
0
        /// <summary>
        /// Handler cancels editing object.
        /// </summary>
        /// <param name="sender">Data grid control sender.</param>
        /// <param name="e">Item event erags.</param>
        private void _DataGridCollectionViewSourceCancelingEdit(object sender, DataGridItemHandledEventArgs e)
        {
            e.Handled = true;

            _handler.CancelEditItem(e);
        }
Exemplo n.º 16
0
 private void DataGridCollectionViewSource_CancelingEdit(object sender, DataGridItemHandledEventArgs e)
 {
     e.Handled           = true;
     IsEditingInProgress = false;
     _SetSelectionStatus();
 }
Exemplo n.º 17
0
 /// <summary>
 /// React on DataGridCollectionViewSource CancelingEdit.
 /// </summary>
 /// <param name="sender">Ignored.</param>
 /// <param name="e">Data grid item handled event argsuments.</param>
 private void DataGridCollectionViewSource_CancelingEdit(object sender,
                                                         DataGridItemHandledEventArgs e)
 {
     e.Handled = true;
 }