Eric Eric - 3 years ago 119
ASP.NET (C#) Question

What is the sequence of events firing off in asp.net Gridview control?

I use GridViews pretty often and sometimes I get confused to where to put certain code. What is the sequence that events are fired off including all page events?

Edited:
I really am also trying to understand what happens between the page and the Gridview. Do the events ever cross? Or do all page events occur at once then all Gridview events occur? And not just GridViews, any control - but mostly page and GridView interaction.

Answer Source
protected void GridView1_Load(object sender, EventArgs e)
{
   System.Diagnostics.Debug.WriteLine("GridView1_Load");
}
protected void GridView1_DataBinding(object sender, EventArgs e)
{
   System.Diagnostics.Debug.WriteLine("GridView1_DataBinding");
}
protected void GridView1_DataBound(object sender, EventArgs e)
{
   System.Diagnostics.Debug.WriteLine("GridView1_DataBound");
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
   System.Diagnostics.Debug.WriteLine("GridView1_RowDataBound");
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download