コード例 #1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if ((dgvAppLinks.Rows.Count > 0) && (dgvAppLinks.SelectedRows.Count > 0))
            {
                int    LinkId;
                string Description = dgvAppLinks.CurrentRow.Cells[1].Value.ToString();
                LinkId = Convert.ToInt32(dgvAppLinks.CurrentRow.Cells[0].Value.ToString());

                if (MessageBox.Show("Are you sure you want to delete the App Link: " + Description, "Delete App Link", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    DALHelpers.DeleteAppLink(LinkId);
                    System.Threading.Thread.Sleep(1000);
                    loadAppLinks();
                    dgvAppLinks.ClearSelection();
                }
                else
                {
                    dgvAppLinks.ClearSelection();
                }
                txtAppLinkSearch.Clear();
            }
        }