using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class TreeView_Templates_Template : System.Web.UI.UserControl
{

    //Item's variable (optional) 
    public APNSoft.WebControls.TreeViewElement TreeViewElement = null;

    protected void Page_Load(object sender, EventArgs e)
    {

        //Item's Data (optional)
        string ItemsData = "";
        if (TreeViewElement != null)
        {
            ItemsData = "ItemID: " + TreeViewElement.id;
            ItemsData += ", Title: " + TreeViewElement.title;
        }



        //Add Header
        lblHeader.Text = " on <b>" + DateTime.Now.ToString("ddd dd MMM, yyyy") + "</b>:";


        //Create Table
        Table myTable = new Table();
        myTable.Attributes.Add("width", "400");
        myTable.Attributes.Add("cellpadding", "4");
        myTable.Attributes.Add("style", "white-space:normal;");

        TableRow r = null;
        TableCell c = null;


        //Add Row
        r = new TableRow();
        c = new TableCell();
        c.Controls.Add(new LiteralControl("<img src='~/TreeView/Images/tvHowDo.jpg' vspace=2 border=1 width=60 height=60 />"));
        r.Cells.Add(c);
        c = new TableCell();
        c.Controls.Add(new LiteralControl("<b>06:00 HOW DO THEY DO IT?</b><br/><small>How do wipers keep windscreens clear, how do they launch a rocket into space and how do they make the perfect lenses for modern binoculars?</small>"));
        r.Cells.Add(c);
        myTable.Rows.Add(r);


        //Add Row
        r = new TableRow();
        c = new TableCell();
        c.Controls.Add(new LiteralControl("<img src='~/TreeView/Images/tvHowIts.jpg' vspace=2 border=1 width=60 height=60 />"));
        r.Cells.Add(c);
        c = new TableCell();
        c.Controls.Add(new LiteralControl("<b>07:00 HOW IT'S MADE</b><br/><small>Cranberries, cotton yarns and road signs. More everyday objects are put under the microscope as we find out how they are made.</small>"));
        r.Cells.Add(c);
        myTable.Rows.Add(r);


        //Add Row
        r = new TableRow();
        c = new TableCell();
        c.Controls.Add(new LiteralControl("<img src='~/TreeView/Images/tvExtreme.jpg' vspace=2 border=1 width=60 height=60 />"));
        r.Cells.Add(c);
        c = new TableCell();
        c.Controls.Add(new LiteralControl("<b>08:00 EXTREME ENGINEERING</b><br/><small>Danny Forster goes behind the scenes at the Port of Rotterdam, where crews are in the middle of the largest Earth-moving project in history - all to triple the port's capacity.</small>"));
        r.Cells.Add(c);
        myTable.Rows.Add(r);


        //Add Row
        r = new TableRow();
        c = new TableCell();
        c.Controls.Add(new LiteralControl("<img src='~/TreeView/Images/tvFutureWeap.jpg' vspace=2 border=1 width=60 height=60 />"));
        r.Cells.Add(c);
        c = new TableCell();
        c.Controls.Add(new LiteralControl("<b>09:00 FUTURE WEAPONS</b><br/><small>Discover front line weapons, including the XM307 grenade launcher, hi-tech equipment for combat soldiers and the Stryker family of fighting vehicles.</small>"));
        r.Cells.Add(c);
        myTable.Rows.Add(r);


        //Add Row
        r = new TableRow();
        c = new TableCell();
        c.Controls.Add(new LiteralControl("<img src='~/TreeView/Images/tvMyth.jpg' vspace=2 border=1 width=60 height=60 />"));
        r.Cells.Add(c);
        c = new TableCell();
        c.Controls.Add(new LiteralControl("<b>10:00 MYTHBUSTERS</b><br/><small>Adam and Jamie investigate whether an action hero can protect his cast members from a grenade blast and test an internet video with an outrageous claim.</small>"));
        r.Cells.Add(c);
        myTable.Rows.Add(r);


        //Add Table to the Place Holder
        phSchedule.Controls.Add(myTable);
    }
}