Hi, we have inherited the Prometheus Grid and we are wondering what are the best practices when it comes to use events.
Is it better to use event handlers or override the On... function?
For example
public class Grid : Telerik.Web.UI.RadGrid
{
protected override bool OnNeedDataSource(Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
bool baseValue = base.OnNeedDataSource(e);
do stuff here
return baseValue;
}
}
Or I could have done in the Grid() constructor adding a event and implementing the previous code in the event handler.
I am wondering what is the best practice?
Thanks
Is it better to use event handlers or override the On... function?
For example
public class Grid : Telerik.Web.UI.RadGrid
{
protected override bool OnNeedDataSource(Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
bool baseValue = base.OnNeedDataSource(e);
do stuff here
return baseValue;
}
}
Or I could have done in the Grid() constructor adding a event and implementing the previous code in the event handler.
I am wondering what is the best practice?
Thanks