예제 #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);
                }
            }
        }
예제 #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);
            }
        }
예제 #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();
        }