The other day I built a user control that dynamically builds a data display from a given custom business object.
It works well but I'd like to use the control in other applications and the way it is currently encapsulated is sub par.
My custom user control just contains the basic html controls and a few internal properties so I can access them from my other class.
In the same assembly I have a class DataManager - It takes an IEnumerable and a reference to its associated user control. The problem is that I have to handle implementation details like redrawing on Page_Init from the page calling the control as the actual user control has no knowledge of T.
Is there a way to pass a generic type to the user control to simplify things, or a way to store a reference to the DataManager object without specifying T?
Thanks for your help!