Imports Microsoft.VisualBasic
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls

Namespace SampleWithTwoGantts
	''' <summary>
	''' Summary description for WebForm1.
	''' </summary>
	Public Class WebForm1 : Inherits System.Web.UI.Page
	Protected WithEvents Gantt_ASP1 As PlexityHide.GTP.WEB.Gantt_ASP
	Protected Gantt_ASP2 As PlexityHide.GTP.WEB.Gantt_ASP

	Private Sub AddRow(ByVal ga As PlexityHide.GTP.WEB.Gantt_ASP)
	  Dim gn As PlexityHide.GTP.GridNode=ga.Gantt.Grid.GridStructure.RootNodes.AddNode()
	  gn.GetCell(0).Content.Value="<span title=""Im a cell"">Hello</span>"

	  gn=ga.Gantt.Grid.GridStructure.RootNodes.AddNode()
	  gn.GetCell(0).Content.Value="<span title=""VeryVeryLongtextthatmightgiveproblems"">VeryVeryLongtextthatmightgiveproblems xxxx</span>"

	  Dim ti As PlexityHide.GTP.TimeItem=PlexityHide.GTP.GanttRow.FromGridNode(gn).Layers(0).AddNewTimeItem()
	  ti.Start=ga.Gantt.DateScaler.StartTime.AddDays(5)
	  ti.Stop=ti.Start.AddDays(5)

	End Sub
		Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
			' Put user code to initialize the page here
	  Gantt_ASP1.Gantt.PyjamasColor = Color.AliceBlue
	  Gantt_ASP1.Gantt.PyjamasGradientColor = Color.AliceBlue
	  Gantt_ASP1.Gantt.BackColor = Color.Honeydew
	  Gantt_ASP1.Gantt.DrawPyjamas = True

	  Gantt_ASP1.UseColumnWidths=False


	  Gantt_ASP2.UseColumnWidths=True


	  Gantt_ASP1.Gantt.Grid.RootNodes.Clear()
	  Gantt_ASP2.Gantt.Grid.RootNodes.Clear()

	  AddRow(Gantt_ASP1)
	  AddRow(Gantt_ASP1)
	  AddRow(Gantt_ASP1)
	  AddRow(Gantt_ASP1)

	  AddRow(Gantt_ASP2)
	  AddRow(Gantt_ASP2)
	  AddRow(Gantt_ASP2)
	  AddRow(Gantt_ASP2)
		End Sub

		#Region "Web Form Designer generated code"
		Overrides Protected Sub OnInit(ByVal e As EventArgs)
			'
			' CODEGEN: This call is required by the ASP.NET Web Form Designer.
			'
			InitializeComponent()
			MyBase.OnInit(e)
		End Sub

		''' <summary>
		''' Required method for Designer support - do not modify
		''' the contents of this method with the code editor.
		''' </summary>
		Private Sub InitializeComponent()
'	  Me.Gantt_ASP1.OnAreaAttributes += New PlexityHide.GTP.WEB.AreaAttributeEvent(Me.Gantt_ASP1_OnAreaAttributes);
'	  Me.Load += New System.EventHandler(Me.Page_Load);

		End Sub
		#End Region

	Private Sub Gantt_ASP1_OnAreaAttributes(ByVal aGantt As PlexityHide.GTP.WEB.Gantt_ASP, ByVal e As PlexityHide.GTP.WEB.AreaAttributeEventArgs) Handles Gantt_ASP1.OnAreaAttributes
	  If e.AreaKind=PlexityHide.GTP.WEB.AreaKind.TimeItem Then

		e.Result=" Title=""You are now over a time item"" onMouseOver=""self.status='Hey man, your are over a time item';return true"" "
	  Else
	  If e.AreaKind=PlexityHide.GTP.WEB.AreaKind.TimeItemRow Then
		e.Result=" Title=""Click this one if you are happy"" onMouseOver=""self.status='YOU ARE NOW ON THE ROW, and not over a time item';return true"" "
	  Else
		e.Result=" onMouseOver=""self.status='---';return true"" " & e.Result
	  End If
	  End If

	End Sub
	End Class
End Namespace
