views:

540

answers:

1

Hi Guys,

I have a Tab Panel which has a text Upcoming Birthdays and i run a query to find if there are any upcoming birthdays and bind them to a datalist.

so i want to show the count of birthdays as Upcoming Birthday(1) or Upcoming Birthday(2) but i cant find any way from code behind to do this

my tab index is 2 and even if i do this

TabContainer1.Tabs(2).HeaderTemplate ??????? i cant figure what to do next..it only contains a method InstantiateIn()

if anyone knows how to edit a template plz tell me....

Thnaks a lot

A: 

Create a new class called MyHeaderTemplate based on the ITemplate interface. In the new class, add an implementation of the InstantiateIn() method to customise the template contents.

public class MyHeaderTemplate : ITemplate
{
   public void InstantiateIn(Control container)
   {
      //TODO: Add you customisation here...
      Label lbl = new Label();
      lbl.Text = "foo";

      // Lastly, add the controls to the container...
      container.Controls.Add(lbl);
   }
}

Once the new class is created, assign it to the HeaderTemplate of your tabs. e.g.

TabContainer1.Tabs(2).HeaderTemplate = new MyHeaderTemplate()
Geoff