Re: 'hide' DataBind method
As quoted from here :
http://www.dotnetperls.com/private-virtual-methods
Quote:
Private virtual methods make no sense. The reason private virtual methods are nonsensical is because whenever a private method is invoked, the type has already been entered—you can always define custom private methods on a type and if you are already inside the type, you can simply call a regular instance private method. Further, instance and static methods are faster to invoke than interface and virtual methods, so there is a performance advantage to not using a private virtual method.
Perhaps if we have a better understanding of what your class looks like, we could possibly assist further :)
Re: 'hide' DataBind method
My custom control is simply displaying some data which I select in the database. But to select the data, I need several paramaters. So I could declare these parameters in public properties, and make sure these properties are set before calling the DataBind method. But if multiple paramaters are required, it's easy to forget one. Or what if some of them are optional parameters? Using the properties, it's hard to see what is required and what not.
So if there paramaters are set using parameters in the DataBind method, it's impossible to forget to set them correctly, and you can see inmediately which are required and which are optional.
I hope I clarified myself now