EventArgs used by the FocusRowLeaving
Inheritance: RowEventArgs
Example #1
0
 /// <summary>
 /// Fired before a row lost the focus
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnFocusRowLeaving(RowCancelEventArgs e)
 {
     if (FocusRowLeaving != null)
     {
         FocusRowLeaving(this, e);
     }
 }
Example #2
0
        private void Selection_FocusRowLeaving(object sender, RowCancelEventArgs e)
        {
            try
            {
                EndEditingRow(false);
            }
            catch (Exception exc)
            {
                OnUserException(new ExceptionEventArgs(new EndEditingException(exc)));

                e.Cancel = true;
            }
        }
Example #3
0
		private void Selection_FocusRowLeaving(object sender, RowCancelEventArgs e)
		{
			try
			{
				EndEditingRow(false);
			}
			catch(Exception exc)
			{
				OnUserException(new ExceptionEventArgs(new EndEditingException( exc ) ) );

				e.Cancel = true;
			}
		}
 private void Selection_FocusRowLeaving(object sender, RowCancelEventArgs e)
 {
     btDown.Enabled   = false;
     btUp.Enabled     = false;
     btRemove.Enabled = false;
 }
Example #5
0
		private void Selection_FocusRowLeaving(object sender, RowCancelEventArgs e)
		{
			btDown.Enabled = false;
			btUp.Enabled = false;
			btRemove.Enabled = false;
		}
Example #6
0
        /// <summary>
        /// Fired when a cell lost the focus
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnCellLostFocus(ChangeActivePositionEventArgs e)
        {
            if (e.Cancel)
            {
                return;
            }

            CellContext cellLostContext = new CellContext(Grid, e.OldFocusPosition);

            //Stop the Edit operation
            if (cellLostContext.EndEdit(false) == false)
            {
                e.Cancel = true;
            }

            if (e.Cancel)
            {
                return;
            }

            //evento Lost Focus
            if (CellLostFocus != null)
            {
                CellLostFocus(this, e);
            }
            if (e.Cancel)
            {
                return;
            }

            //Row/Column leaving
            //If the new Row is different from the current focus row calls a Row Leaving event
            int focusRow = ActivePosition.Row;

            if (ActivePosition.IsEmpty() == false && focusRow != e.NewFocusPosition.Row)
            {
                RowCancelEventArgs rowArgs = new RowCancelEventArgs(focusRow);
                OnFocusRowLeaving(rowArgs);
                if (rowArgs.Cancel)
                {
                    e.Cancel = true;
                    return;
                }
            }
            //If the new Row is different from the current focus row calls a Row Leaving event
            int focusColumn = ActivePosition.Column;

            if (ActivePosition.IsEmpty() == false && focusColumn != e.NewFocusPosition.Column)
            {
                ColumnCancelEventArgs columnArgs = new ColumnCancelEventArgs(focusColumn);
                OnFocusColumnLeaving(columnArgs);
                if (columnArgs.Cancel)
                {
                    e.Cancel = true;
                    return;
                }
            }

            //Change the focus cell to Empty
            m_ActivePosition = Position.Empty; //from now the cell doesn't have the focus

            //Cell Focus Left
            Grid.Controller.OnFocusLeft(new CellContext(Grid, e.OldFocusPosition), EventArgs.Empty);
        }