I want to create a Repeater that displays the header/footer based on properties, only if the DataSource
is empty.
public class Repeater : System.Web.UI.WebControls.Repeater
{
public bool ShowHeaderOnEmpty { get; set; }
public bool ShowFooterOnEmpty { get; set; }
[DefaultValue((string)null),
PersistenceMode(PersistenceMode.InnerProperty),
TemplateContainer(typeof(System.Web.UI.WebControls.RepeaterItem)),
Browsable(false)]
public ITemplate EmptyTemplate { get; set; }
}
I also want to create a EmptyTemplate
, if the DataSource
is empty display this template...
I have no idea on how to implement this. What should I override to achieve this behavior?