DayPilot Forums

DayPilot is the best open-source Outlook-like calendar control for ASP.NET.
DayPilot Pro Demo (Calendar control)
» DayPilot Pro live demo (Calendar control)
DayPilot Pro Demo (Scheduler control)
» DayPilot Pro live demo (Scheduler control)
Home » How To » Code Example for ResourceBubbleID

Code Example for ResourceBubbleID

Hi

Any sample code for using the ResourceBubbleID?

I'd like to setthem the same time as the Resouces.

Try
conn.Open()
reader = comm.ExecuteReader
While reader.Read
DayPilotScheduler1.Resources.Add(reader.Item("fldCar").ToString & " " & reader.Item("fldRegistration").ToString, reader.Item("fldCarID").ToString)
'DayPilotScheduler1.ResourceBubbleID = reader.Item("fldCarNotes").ToString ??????????????????
End While
reader.Close()
conn.Close()

Catch ex As Exception

John - 6/2/2008 12:42:41 AM

Hi, Just in case any one needs this...

1. You need to add a DayPilotBubble control
<DayPilot:DayPilotBubble ID="DayPilotBubble2" runat="server" ClientObjectName="rbubble"/>

2. You need to add a reference to this control in the DayPilotScheduler
ResourceBubbleID="DayPilotBubble2"

3. Add code similar to below to actually enter the content of the Bubble

Private Sub DayPilotBubble2_RenderContent(ByVal sender As Object, ByVal e As DayPilot.Web.Ui.Events.Bubble.RenderEventArgs) Handles DayPilotBubble2.RenderContent

'You need to Cast the Args of the sub so you can pick up the resource ID
Dim re As DayPilot.Web.Ui.Events.Bubble.RenderResourceBubbleEventArgs
re = CType(e, DayPilot.Web.Ui.Events.Bubble.RenderResourceBubbleEventArgs)

'Now use re.ResourceId with your Database connection or whatever to find the info you need
'eg do a select to find moreinfo based on ID of resource = re.ResourceId and feed the result into the innerHTML

e.InnerHTML = "Vehicle:<b>" & reader.Item("fldVehicle").ToString & "</b>"
End Sub

Hope that helps

John - 6/26/2008 6:29:23 PM
John, Thanks for posting the answer!
Dan Letecky - 6/27/2008 9:25:26 PM
Post reply