Reputation: 9
I need a little help. I am binding data from database to gridview in asp.net c#, my problem is that when I add, edit,delete and select button in every row then when I click on edit or delete button then no any action perform. can anyone help me.Thank you in advance.
here is source code for that
string str = "select max(trans_id) from purchase";
DataSet ds = new DataSet();
ds = c.FetchData(str);
if (ds.Tables[0].Rows.Count > 0)
{
GridView1.DataSource = c.FetchData("select * from pur_trans where trans_id=" + ddltansid.SelectedValue.ToString() + "".Tables[0];
GridView1.DataBind();
GridView1.Visible = true;
}
else
{
GridView1.Visible = false;
}![enter image description here][1]
Upvotes: 1
Views: 608
Reputation: 509
You need to add the events for edit and delete. Please go through below given link and read all the steps given into it:
http://www.codeproject.com/Articles/667599/Add-Edit-update-Delete-gridview
Upvotes: 1