I'm working with a GridView in an UpdatePanel and perform databinding to an ObjectDataSource using the DataSourceID property. Everything works just fine except for when I perform data validation in the object source and return false
from the Update. I use this to set the content and visibility of another control in the GridView. However, this never shows up since the GridView performs a hidden DataBind()
in OnPreRender()
even though EnableViewState = "true"
(via the BaseDataBoundControl).
Is there an easy way to just turn this extraneous DataBind()
off? I've used reflection to set the _requiresDataBind
field in BaseDataBoundControl to false
and all works as I'd like it to work, but this is hardly a production-worthy approach. Is subclassing GridView the only way? Am I just missing something?