예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="AcceptChanges"></param>
        public void EndEditing(bool AcceptChanges)
        {
            if (_EditingControl == null)
            {
                return;
            }

            SubItemEndEditingEventArgs e = new SubItemEndEditingEventArgs(
                _EditItem,                                                                    // The item being edited
                _EditSubItem,                                                                 // The subitem index being edited
                // Use editControl text if changes are accepted
                AcceptChanges ? _EditingControl.Text : _EditItem.SubItems[_EditSubItem].Text, // or the original subitem's text, if changes are discarded
                !AcceptChanges                                                                // Cancel?
                );

            OnSubItemEndEditing(e);

            _EditItem.SubItems[_EditSubItem].Text = e.DisplayText;

            _EditingControl.Leave    -= new EventHandler(_EditingControl_Leave);
            _EditingControl.KeyPress -= new KeyPressEventHandler(_EditingControl_KeyPress);

            _EditingControl.Visible = false;

            _EditingControl = null;
            _EditItem       = null;
            _EditSubItem    = -1;
        }
예제 #2
0
 protected void OnSubItemEndEditing(SubItemEndEditingEventArgs e)
 {
     if (SubItemEndEditing != null)
     {
         SubItemEndEditing(this, e);
     }
 }