You must Sign In to post a response.

Difference between rowupdated and rowupdating of gridview in asp.net

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


Comments

Author: Ramesh S03 Sep 2009 Member Level: Gold   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.

Author: Amit Gupta03 Sep 2009 Member Level: Gold   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.

Author: gomathinayagam04 Sep 2009 Member Level: Gold   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.

Author: Amit Gupta04 Sep 2009 Member Level: Gold   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.


Sign In to post your comments