Hi Oliver,
After some tests on my local side, seems the Event sequence are always as
we normally expected:
Contro's creation events ----> Page_Load/Control's Load events ---->
PostBack events
Also, below is my simple test page, which output
=============
dgEvent_ItemCre ated get called!
dgEvent_ItemCre ated get called!
dgEvent_ItemCre ated get called!
Page_Load get called!
=============
you can also have a test on your side to see whether you still get the
strange event sequence.
=============as px===========
<HTML>
<HEAD>
<title>datagrid footerevent</title>
<meta name="GENERATOR " Content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" Content="C#">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:DataGrid id="dgEvent" runat="server" AutoGenerateCol umns="False"
ShowFooter="Tru e">
<Columns>
<asp:TemplateCo lumn>
<ItemTemplate >
<asp:TextBox id=txtString Text="<%# Container.DataI tem %>"
Runat="server">
</asp:TextBox>
</ItemTemplate>
<FooterTemplate >
<asp:DropDownLi st id="lstEvent" Runat="server" AutoPostBack="T rue"
OnSelectedIndex Changed="lstEve nt_SelectedInde xChanged">
<asp:ListItem Value="aaa">aaa </asp:ListItem>
<asp:ListItem Value="bbb">bbb </asp:ListItem>
<asp:ListItem Value="ccc">ccc </asp:ListItem>
<asp:ListItem Value="ddd">ddd </asp:ListItem>
</asp:DropDownLis t>
</FooterTemplate>
</asp:TemplateCol umn>
</Columns>
</asp:DataGrid>
</form>
</body>
</HTML>
=============== ======
-=============== codebehind===== ========
public class datagridfootere vent : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Data Grid dgEvent;
private void Page_Load(objec t sender, System.EventArg s e)
{
if(!IsPostBack)
{
this.dgEvent.Da taSource = new
string[]{"aaa","bbb","c cc","ddd","eee" ,"fff"};
this.dgEvent.Da taBind();
}
Response.Write( "<br>Page_L oad get called!");
}
//form generated code........... ......
protected void lstEvent_Select edIndexChanged( object sender,
System.EventArg s e)
{
Response.Write( "<br>lstEvent_S electedIndexCha nged get called!");
}
private void dgEvent_ItemCre ated(object sender,
System.Web.UI.W ebControls.Data GridItemEventAr gs e)
{
Response.Write( "<br>dgEvent_It emCreated get called!");
}
}
Hope helps. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)