Ejemplo n.º 1
0
        public virtual void EndCellEdit(object newValue)
        {
            ListView             parentListView = parentColumn.ParentListView;
            CellPosition         pos            = parentListView.EditedCell;
            CellEditEndEventArgs args           = new CellEditEndEventArgs(pos.Column, pos.Row, newValue);
            IListModel           model          = parentListView.Model;

            OnCellEditEnd(args);

            if (string.IsNullOrEmpty(propertyName))
            {
                try {
                    model [pos.Row] = args.NewValue;
                } catch (ArgumentOutOfRangeException) {
                    throw new CellNotValidException(pos.Row);
                }
            }
            else
            {
                try {
                    model [pos.Row, propertyName] = args.NewValue;
                } catch (ArgumentOutOfRangeException) {
                    throw new CellNotValidException(pos.Row, propertyName);
                }
            }
        }
Ejemplo n.º 2
0
        internal virtual void OnCellEditEnd(CellEditEndEventArgs args)
        {
#if DEBUG_LISTVIEW
            Debug.WriteLine(string.Format("Cell received {0} at {1}", "OnCellEditEnd", args.Cell));
#endif
            if (CellEditEnd != null)
            {
                CellEditEnd(this, args);
            }

            if (parentColumn != null)
            {
                parentColumn.OnCellEditEnd(args);
            }
        }
Ejemplo n.º 3
0
        internal virtual void OnCellEditEnd(CellEditEndEventArgs args)
        {
#if DEBUG_LISTVIEW
            Debug.WriteLine(string.Format("ListView received {0} at {1}", "OnCellEditEnd", args.Cell));
#endif
            HasFocus = true;
            GrabFocus();

            if (CellEditEnd != null)
            {
                CellEditEnd(this, args);
            }

            editedCell = CellPosition.Empty;
            InvalidateList();
        }