public void OnEndPopup(I3CellEditEventArgs e) { if (this.EndPopup != null) { this.EndPopup(this, e); } }
/// <summary> /// 引发取消编辑事件 /// Raises the CancelEdit event /// </summary> /// <param name="e">A CellEditEventArgs that contains the event data</param> protected virtual void OnCancelEdit(I3CellEditEventArgs e) { if (this.CancelEdit != null) { this.CancelEdit(this, e); } }
public void OnBeforePopup(I3CellEditEventArgs e) { if (this.BeforePopup != null) { this.BeforePopup(this, e); } }
public void OnExtendEdit(I3CellEditEventArgs e) { if (this.ExtendEdit != null) { this.ExtendEdit(this, e); } }
/// <summary> /// 引发开始编辑事件 /// Raises the BeginEdit event /// </summary> /// <param name="e">A CellEditEventArgs that contains the event data</param> protected virtual void OnBeginEdit(I3CellEditEventArgs e) { if (this.BeginEdit != null) { this.BeginEdit(this, e); } }
void PopupCellEditor_BeginEdit(object sender, I3CellEditEventArgs e) { I3Column column = e.Table.ColumnModel.Columns[e.Column]; if (column.GetType() == typeof(I3PopupColumn)) { I3PopupColumn popupColumn = (I3PopupColumn)column; popupColumn.OnBeforePopup(e); } }
void ExtendCellEditor_BeginEdit(object sender, I3CellEditEventArgs e) { I3Column column = e.Table.ColumnModel.Columns[e.Column]; if (column.GetType() == typeof(I3ExtendColumn)) { I3ExtendColumn extendColumn = (I3ExtendColumn)column; extendColumn.OnExtendEdit(e); } e.Cancel = true; }
/// <summary> /// 虚拟方法,退出编辑,在ICellEditor中定义 /// Stops editing the Cell and ignores any changes /// </summary> public virtual void CancelEditing() { Application.RemoveMessageFilter(this.keyMessageFilter); Application.RemoveMessageFilter(this.mouseMessageFilter); // I3CellEditEventArgs e = new I3CellEditEventArgs(this.cell, this, this.table, this.cellPos.Row, this.cellPos.Column, this.cellRect); this.table.OnEditingCancelled(e); this.OnCancelEdit(e); this.RemoveEditControl(); }
/// <summary> /// 虚拟方法,结束编辑,在ICellEditor中定义 /// Stops editing the Cell and commits any changes /// </summary> public virtual void StopEditing() { Application.RemoveMessageFilter(this.keyMessageFilter); Application.RemoveMessageFilter(this.mouseMessageFilter); // I3CellEditEventArgs e = new I3CellEditEventArgs(this.cell, this, this.table, this.cellPos.Row, this.cellPos.Column, this.cellRect); this.OnEndEdit(e); if (!e.Cancel && !e.Handled) { this.SetCellValue(); } this.table.OnEditingStopped(e); this.RemoveEditControl(); }
/// <summary> /// 虚拟方法,准备编辑,在ICellEditor中定义 /// Prepares the CellEditor to edit the specified Cell /// </summary> /// <param name="cell">The Cell to be edited</param> /// <param name="table">The Table that contains the Cell</param> /// <param name="cellPos">A CellPos representing the position of the Cell</param> /// <param name="cellRect">The Rectangle that represents the Cells location and size</param> /// <param name="userSetEditorValues">Specifies whether the ICellEditors /// starting value has already been set by the user</param> /// <returns>true if the ICellEditor can continue editing the Cell, false otherwise</returns> public virtual bool PrepareForEditing(I3Cell cell, I3Table table, I3CellPos cellPos, Rectangle cellRect, bool userSetEditorValues) { //初始化值 this.cell = cell; this.table = table; this.cellPos = cellPos; this.cellRect = cellRect; //检查用户是否已经自己设置了编辑控件的值,如果没有则调用 SetEditValue() 方法进行设置 // check if the user has already set the editors value for us if (!userSetEditorValues) { this.SetEditValue(); } //设置编辑控件的位置和大小 this.SetEditLocation(cellRect); //引发开始编辑事件 // raise the BeginEdit event I3CellEditEventArgs e = new I3CellEditEventArgs(cell, this, table, cellPos.Row, cellPos.Column, cellRect); e.Handled = userSetEditorValues; this.OnBeginEdit(e); //如果编辑被退出,移动编辑控件并返回false // if the edit has been canceled, remove the editor and return false if (e.Cancel) { this.RemoveEditControl(); return(false); } return(true); }