I want to hide/delete a specific row from gridview when user clicks a button. The gridview should not display the hidden/deleted row even if the page is refreshed or loaded for the second time. The data deleted on the gridview should not affect the database.
My Aspx Code:
Approve or Reject Subjects
Course:
CommandName="Select"/>
My Code Behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Text.RegularExpressions;
using System.Data;
using System.Configuration;
namespace Subject_Registration_System_for_IUMW
{
public partial class Approve_or_Reject : System.Web.UI.Page
{
SqlConnection con = new SqlConnection("Data Source=User-PC\\User;Initial Catalog=Subject Registration System;Integrated Security=True");
protected void Page_Load(object sender, EventArgs e)
{
if (Session["username"] != null)
{
Label1.Text = Session["username"].ToString();
}
con.Open();
SqlCommand cmd = new SqlCommand("SELECT Course FROM Subjects", con);
DDL1.DataSource = cmd.ExecuteReader();
DDL1.DataValueField = "Course";
DDL1.DataTextField = "Course";
DDL1.DataBind();
con.Close();
}
}
}
Please help me
Thank you

Suvendu Shekhar GiriRank #546 · 4.4K reputationPosted Feb 23, 2017, 2:38 AM EST
Azm Amn110 reputationPosted Feb 23, 2017, 2:49 AM EST
Suvendu Shekhar Giri
Joginder BangerRank #360 · 7K reputationPosted Feb 23, 2017, 5:23 AM EST
Azm Amn110 reputationPosted Feb 23, 2017, 5:09 PM EST