Last post Jul 28, 2008 10:05 AM by gilkesm
Jul 28, 2008 09:18 AM|gilkesm|LINK
I am writing a new custom control to provide a wrapper around a Flash control. My control inherits from DataBoundControl. Databinding code comprises PerformSelect and PerformDataBinding and I am retrieving the data ok. My problem arises in that I need to
break points in my code I notice OnPreRender was firing before PerformDataBing?? How can this be? Is there anyway I can force the data to bind before my PreRender method is executed??
Jul 28, 2008 09:56 AM|shados|LINK
PerformDataBind will be one of the last things to happen. It is a little bit like CreateChildControls for CompositeControls.
If you need values from the databinding step, you must call EnsureDataBound. If the control was already databound (because the caller forced it, for example, by calling DataBind), it will do absolutely nothing. But if it wasn't, it will, well, ensure that
the databound stuff is done when you need it. It is fairly common to call EnsureDataBound in the pre-render step.
Jul 28, 2008 10:05 AM|gilkesm|LINK