protected void dgCountryCode_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Edit") { dtTablesData = reasonCode.GetReasonCodeData("pTableID = '" + e.CommandArgument + "'"); DisplayRecord(); btncheck(); btnSave.Visible = (CountrySecurity != "") ? true : false; ScriptManager.RegisterClientScriptBlock(txtDescription, txtDescription.GetType(), "focud", "document.getElementById('" + txtDescription.ClientID + "').select();document.getElementById('" + txtDescription.ClientID + "').focus();", true); } if (e.CommandName == "Delete") { ViewState["Operation"] = "Delete"; reasonCode.DeleteTablesData(e.CommandArgument.ToString()); BindDataGrid(); DisplaStatusMessage(deleteMessage, "Success"); Clear(); } ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Focus", "document.getElementById('div-datagrid').scrollTop='" + hidScrollTop.Value + "';", true); UpdatePanels(); }