示例#1
0
        /// <summary>
        /// Prepares this control to edit the specified column and item.
        /// </summary>
        /// <param name="tableColumn"></param>
        /// <param name="item"></param>
        internal void BeginEdit(ITableColumn tableColumn, object item)
        {
            // remove any previous event subscription
            if (_editor != null)
            {
                _editor.ValueChanged -= ValueChangedEventHandler;
            }

            _tableColumn = tableColumn;

            // get cell editor for this column
            _editor = tableColumn.GetCellEditor();
            _editor.BeginEdit(item);

            // subscribe to event so we know when cell is dirtied
            _editor.ValueChanged += ValueChangedEventHandler;

            // create editor view only once
            if (_editorView == null)
            {
                _editorView = (ITableCellEditorView)ViewFactory.CreateAssociatedView(_editor.GetType());
                var control = (Control)_editorView.GuiElement;
                control.Dock = DockStyle.Fill;
                this.Controls.Add(control);
            }
            // associate view with current editor
            _editorView.SetEditor(_editor);
        }
 public void SetEditor(ITableCellEditor editor)
 {
     _control.SetEditor((ComboBoxCellEditor)editor);
 }
示例#3
0
 public void SetEditor(ITableCellEditor editor)
 {
     _control.SetEditor((LookupHandlerCellEditor)editor);
 }
		/// <summary>
		/// Prepares this control to edit the specified column and item.
		/// </summary>
		/// <param name="tableColumn"></param>
		/// <param name="item"></param>
		internal void BeginEdit(ITableColumn tableColumn, object item)
		{
			// remove any previous event subscription
			if (_editor != null)
			{
				_editor.ValueChanged -= ValueChangedEventHandler;
			}

			_tableColumn = tableColumn;

			// get cell editor for this column
			_editor = tableColumn.GetCellEditor();
			_editor.BeginEdit(item);

			// subscribe to event so we know when cell is dirtied
			_editor.ValueChanged += ValueChangedEventHandler;

			// create editor view only once
			if (_editorView == null)
			{
				_editorView = (ITableCellEditorView)ViewFactory.CreateAssociatedView(_editor.GetType());
				var control = (Control) _editorView.GuiElement;
				control.Dock = DockStyle.Fill;
				this.Controls.Add(control);
			}
			// associate view with current editor
			_editorView.SetEditor(_editor);
		}
		public void SetEditor(ITableCellEditor editor)
		{
			_control.SetEditor((LookupHandlerCellEditor)editor);
		}
		public void SetEditor(ITableCellEditor editor)
		{
			_control.SetEditor((ComboBoxCellEditor)editor);
		}