/// <summary>
		/// Accept or discard current value of cell editor control
		/// </summary>
		/// <param name="AcceptChanges">Use the _editingControl's Text as new SubItem text or discard changes?</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
				AcceptChanges ?
					_editingControl.Text :	// Use editControl text if changes are accepted
					_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(_editControl_Leave);
			_editingControl.KeyPress -= new KeyPressEventHandler(_editControl_KeyPress);

			_editingControl.Visible = false;

			_editingControl = null;
			_editItem = null;
			_editSubItem = -1;
		}
        private void lsConnections_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e)
        {
            try
            {
                Connection con = e.Item.Tag as Connection;

                if (e.SubItem == 0)
                {
                    con.Name = e.DisplayText;
                }
                if (e.SubItem == 1)
                {
                    con.Host = e.DisplayText;
                }
                else if (e.SubItem == 2)
                {
                    con.Port = Int32.Parse(e.DisplayText);
                }
                else if (e.SubItem == 3)
                {
                    con.Username = e.DisplayText;
                }
            }
            catch (Exception)
            {
                MessageBox.Show("The information you provided is not valid. Notice: Port only accept numbers.");
                e.Cancel = true;
            }
        }
		protected void OnSubItemEndEditing(SubItemEndEditingEventArgs e)
		{
			if (SubItemEndEditing != null)
				SubItemEndEditing(this, e);
		}