Home Unanswered Active Tags New Question

How do I get Event Text to display correctly?

I am using DayPilot Pro and cannot get the text in my events to display correctly.
The header only displays part of the time span and the text (DataTextField) displays right at the border of the header and is in a really tiny font. So tiny you can't even tell what the letters are.

How do I get the text to display correctly?

Thanks

Asked by Anonymous 1 year ago.
Replies
What I did to display text in the event is use the DayPilotCalendar1_BeforeEventRender method. There you can use the e.InnerHTML property to put any HTML inside the Event. To display the time span I used the Start Time
and the End Time. Without the date, as it is in the calendar. Then you can use a bigger font. e.InnerHTML = "" + e.Start.ToString("HH:mm") + "
" + e.End.ToString("HH:mm") + "

" + e.Text; In this event you can define any property of the event box as e.BackgroundImage, e.BackgroundColor, e.ToolTip, e.HeaderHTML="" if you don't want a header, e.DurationBar properties, if it can be moved, resized, deleted... depending on any field comming, for example in the e.Tag collection. Tell me if it was useful for you!
Comment posted by jjsabe 1 year ago.

Thanks again for your help.

The text is now displaying better.

I am using the event headers and even after padding the time range ( Dim sH As String = e.Start.ToShortTimeString & " - " & e.End.ToShortTimeString
sH = sH.PadLeft(40)
e.HeaderHTML = sH) the beginning of the text hides underneath the duration bar.

I am also trying to set the font bold. I tried setting it in the control, in my format procedure and in beforeeventrender and the font remains normal.

Thank you again for your help.

Sheri

Comment posted by Anonymous 1 year ago.
For the font bold, you can use the HTML tag for bold [B]. Remember that you are inserting HTML in the event box. The same you can try for the padding. Maybe you can create a DIV with a left margin. I have not tested this. Hope it helps
Comment posted by jjsabe 1 year ago.

Thank you so much!

I didn't think about it being HTML.

I just added the tags and it worked perfectly. ( e.HeaderHTML = "     " & sH
e.InnerHTML = "<b>" & e.Text.ToString & "</b>")

Thank you again for your help.

Sheri

Comment posted by Anonymous 1 year ago.
Great!
Comment posted by jjsabe 1 year ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java