/// <summary> /// Handle 'delete' button clicks /// </summary> /// <param name="sender">object from which the event was sent</param> /// <param name="e">Arguments to the event</param> private void deleteButton_Click(object sender, EventArgs e) { //If the object can be deleted if (currentUser.isDeleteable) { //Get the currently selected object ADObject current = (ADObject)userBinding.Current; //Temporarily suspend binding so we don't mess it up by deleting items userBinding.SuspendBinding(); //Clear the binding data userBinding.Clear(); //Delete the object from the remote server current.Delete(); //Resume binding userBinding.ResumeBinding(); //Disable controls set_Control_Enable(false); //Update status Set_Status("Delete Succeeded"); } }