Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear friends,
I have gridview and its contain textboxes and Im bind data to that textboxes now im want to make changes that text box data and transfer to DB,I'l do that inside the GridViewRowCommand event,but there are some issues,so im try that inside the GriViewRowUpdating event but that even is does not fire in edit button click event...Please help me????
//this my code

public void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{

string CheckpointName = ((TextBox)GridView1.Rows[e.RowIndex]
.FindControl(somevalue)).Text;
string Query = "UPDATE check_points SET CHECKPOINT_NAME = '" + CheckpointName + "' WHERE ROOT_ID='" + TextBox1.Text + "'";
if (access.insert_delete_update(Query))
{
ScriptManager.RegisterStartupScript(this, this.GetType(),
"Message", "alert(Error);", true);
}
GridView1.EditIndex = -1;
GridView1.DataBind();

}
Posted
Comments
Nandakishore G N 7-Nov-13 6:39am    
paste your design part of page

Hello ,

Try this link.

Asp.net insert, Edit, update, delete data in gridview

thanks
animesh
 
Share this answer
 
Comments
chahthuranga 7-Nov-13 5:55am    
I also did like this friend..it does not work...any way i have little bug,that is when im click update button then how is fireing GridviewUpdate event......
Thanks7872 7-Nov-13 5:59am    
If it works for everyone else,why not for you? Its really embarrassing when people are too lazy to even copy paste the code.
You first Handle RowEditing event in Gridview
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900