protected void TemplateGridView_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DelTempl") { int index = Convert.ToInt32(e.CommandArgument.ToString()); DataTable dtppl = TemplateGridView.DataSource as DataTable; string id = dtppl.Rows[index]["ID"].ToString(); OracleQuery2 cc2 = new OracleQuery2(); cc2.DeleteGTempl(id); BindGrid(); } else if (e.CommandName == "EditTempl") { int index = Convert.ToInt32(e.CommandArgument.ToString()); DataTable dtppl = TemplateGridView.DataSource as DataTable; string id = dtppl.Rows[index]["ID"].ToString(); string text = dtppl.Rows[index]["MESSAGE"].ToString(); TemplID.Text = id; Update.Visible = true; Save.Visible = false; TextMessage.Text = text; grpPanel.Visible = true; AddPanel.Visible = true; } }