I've a similar problem. I've public field in usercontrol, i set it on aspx through databind. I use this control inside/outside datagrid, the only place when user control does not display any value is when I re-bind the grid on some button event of aspx. I tried to analyze the problem and found that Public field value is set at end whereas Oninit, onload are fired by then.
I can post complete help files, please help me resolving it.
TittleJoseph@yahoo.com I'm getting mad
ProjectDetail.ascx.cs
public string ProjectCode
{
set { this.projectCode = value; }
get { return this.projectCode; }
}
protected override void OnLoad(EventArgs e)
{
txtProjectCode.Text = projectCode;
}
a.aspx
<asp:datagrid ..>
<ItemTemplate>
<HCL:ProjectDetail id="ProjectDetail3" runat="server"
ProjectCode='<%#Container.DataItem%>'
/>
..</asp:datagrid>
a.aspx.csprivate void bindgrid()
{
ArrayList AR = new ArrayList();
AR.Add("C052532");
AR.Add("C060879");
DG.DataSource = AR;
DG.DataBind();
}
protected void re_bind_Click(object sender, EventArgs e)
{
bindgrid();
}
------
TittleJoseph@yahoo.com