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