Forums » .NET » ASP.NET »

Difference between rowupdated and rowupdating of gridview in asp.net


Posted Date: 03 Sep 2009      Posted By:: Amit Gupta     Member Level: Gold    Member Rank: 0     Points: 1   Responses: 4



Which event shopuld be used and when?
Same occurs for deleted, deleting.




Responses

#420407    Author: Ramesh S      Member Level: Gold      Member Rank: 106     Date: 03/Sep/2009   Rating: 2 out of 52 out of 5     Points: 2

The RowUpdated event is raised when a row's Update button is clicked, but after the GridView control updates the row.

The RowUpdating event is raised when a row's Update button is clicked, but before the GridView control updates the row.

Thanks & Regards
Ramesh. S
 


 
#420410    Author: Amit Gupta      Member Level: Gold      Member Rank: 0     Date: 03/Sep/2009   Rating: 2 out of 52 out of 5     Points: 2

protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{

int pos = e.RowIndex;

string name = ((TextBox)GridView1.Rows[pos].Cells[2].Controls[0]).Text;

ds.Tables[0].Rows[pos][1] = name;
GridView1.EditIndex = -1;
GridView1.DataBind();
}
I have written the above in rowupdating. It always takes place.
But in rowupdated, i write anything but this event is never raised.


 
#420441    Author: gomathinayagam      Member Level: Gold      Member Rank: 529     Date: 04/Sep/2009   Rating: 2 out of 52 out of 5     Points: 2

if you want to fire rowupdated event, you must fire rowupdating event first.

if you not mention row updating event then row updated event never fired.

Gomathi Nayagam

Please Rate my answer if it has helpful to you





 
#420444    Author: Amit Gupta      Member Level: Gold      Member Rank: 0     Date: 04/Sep/2009   Rating: 2 out of 52 out of 5     Points: 2

RowUpdating is working but RowUpdated does not fire.
gridview is manually bind with datasource. I have come to know that if manually bind, then RowUpdated will never fire.
Plz confirm.


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : Deletion of dataset table rows not working in gridview
Previous : Send mail
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages

Subscribe to Subscribers
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Talk to Webmaster Tony John

Online Members

Priya jain
More...
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India