Last post Oct 01, 2008 09:55 AM by Mantorok
Oct 01, 2008 09:12 AM|Mantorok|LINK
I have a custom control that has a ReadOnly property on it, this will typically be set by the containing page (on say Page_Load). My problem is that CreateChildControls will be called before the page has time to set the ReadOnly property, so at this stage
the ReadOnly property always reads false.
The reason I need to know at the CreateChildControls stage is so that I can exclude certain control creation if ReadOnly = true; is there anyway I can ensure that the ReadOnly value is set before the control creates its children?
Oct 01, 2008 09:32 AM|HLL|LINK
Check the readonly state and remove that child control from controls, in OnPreRender.
Oct 01, 2008 09:55 AM|Mantorok|LINK
Thanks very much - now works a treat.