private void tlDel_Click(object sender, EventArgs e) { if (grdData.SelectedRows == null || grdData.SelectedRows.Count < 1) { return; } if (MsgBoxEx.ConfirmYesNo("Are you sure to delete the record?") == DialogResult.No) { return; } string id = grdData.SelectedRows[0].Cells["ColCode"].Value.ToString(); IsysService service = sysService.GetService(); service.DelUser(id, DataCache.UserInfo.ID); tlSearch.PerformClick(); }