Hi,
I dynamicly add custom control in SelectedIndexChanged even of GridView which is firing after Page_Load. My control is not being rendered to page becouse of that (I assume). How to avoid this situation? Sample below
protected void dgrCompanies_SelectedIndexChanged(object sender, EventArgs e)
{
GoogleControl MyGoogleControl = new GoogleControl ();
PlaceHolderForMap.Controls.Add(MyGoogleControl);
}
Terry Burns - 14 Feb 2006 19:50 GMT
No, your conrol will be rendered after PreRender which happens after this event.
Have you set your control to visible
Have you positioned your control
Have you checked the Z-Order of the control
Is the PlaceHolder visible.
Have you checked that this should appear with no data in it for example ?

Signature
Terry Burns
http://TrainingOn.net
Hi,
I dynamicly add custom control in SelectedIndexChanged even of GridView which is firing after Page_Load. My control is not being rendered to page becouse of that (I assume). How to avoid this situation? Sample below
protected void dgrCompanies_SelectedIndexChanged(object sender, EventArgs e)
{
GoogleControl MyGoogleControl = new GoogleControl ();
PlaceHolderForMap.Controls.Add(MyGoogleControl);
}
GS - 14 Feb 2006 20:25 GMT
Control is not positioned on webpage at all. My understanding that I can load it programmatically without putting it on webpage (one reference is set at <%@ reference
Placeholder is visible. Code below works fine for TextBox control for example but not for custom control.
No, your conrol will be rendered after PreRender which happens after this event.
Have you set your control to visible
Have you positioned your control
Have you checked the Z-Order of the control
Is the PlaceHolder visible.
Have you checked that this should appear with no data in it for example ?
--
Terry Burns
http://TrainingOn.net
"GS" <nospam@nowhere.com> wrote in message news:ObgfvmZMGHA.1532@TK2MSFTNGP12.phx.gbl...
Hi,
I dynamicly add custom control in SelectedIndexChanged even of GridView which is firing after Page_Load. My control is not being rendered to page becouse of that (I assume). How to avoid this situation? Sample below
protected void dgrCompanies_SelectedIndexChanged(object sender, EventArgs e)
{
GoogleControl MyGoogleControl = new GoogleControl ();
PlaceHolderForMap.Controls.Add(MyGoogleControl);
}
Terry Burns - 14 Feb 2006 23:39 GMT
Hold on, your original post asked.
>My control is not being rendered to page becouse of that (I assume).
So what is it you think isnt happening that you think should ?

Signature
Terry Burns
http://TrainingOn.net
Control is not positioned on webpage at all. My understanding that I can load it programmatically without putting it on webpage (one reference is set at <%@ reference
Placeholder is visible. Code below works fine for TextBox control for example but not for custom control.
"Terry Burns" <me@mine.com> wrote in message news:%23rkEKAaMGHA.3196@TK2MSFTNGP09.phx.gbl...
No, your conrol will be rendered after PreRender which happens after this event.
Have you set your control to visible
Have you positioned your control
Have you checked the Z-Order of the control
Is the PlaceHolder visible.
Have you checked that this should appear with no data in it for example ?
--
Terry Burns
http://TrainingOn.net
"GS" <nospam@nowhere.com> wrote in message news:ObgfvmZMGHA.1532@TK2MSFTNGP12.phx.gbl...
Hi,
I dynamicly add custom control in SelectedIndexChanged even of GridView which is firing after Page_Load. My control is not being rendered to page becouse of that (I assume). How to avoid this situation? Sample below
protected void dgrCompanies_SelectedIndexChanged(object sender, EventArgs e)
{
GoogleControl MyGoogleControl = new GoogleControl ();
PlaceHolderForMap.Controls.Add(MyGoogleControl);
}
Teemu Keiski - 15 Feb 2006 08:27 GMT
Hi,
Dynamical controls would need to be added on every request. Control
instances aren't stored anywehere, and as you create them initially in code,
you are also responsible for creating them on postback (subsequently as long
as control is "in action")
FYI: http://aspnet.4guysfromrolla.com/articles/092904-1.aspx

Signature
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
Hi,
I dynamicly add custom control in SelectedIndexChanged even of GridView
which is firing after Page_Load. My control is not being rendered to page
becouse of that (I assume). How to avoid this situation? Sample below
protected void dgrCompanies_SelectedIndexChanged(object sender, EventArgs e)
{
GoogleControl MyGoogleControl = new GoogleControl ();
PlaceHolderForMap.Controls.Add(MyGoogleControl);
}