search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How do I get Event Text to display correctly?

Asked by Anonymous
11 years ago.

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

Comment posted by jjsabe
11 years ago.
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 Anonymous
11 years 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 jjsabe
11 years 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 Anonymous
11 years 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 jjsabe
11 years ago.
Great!
This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.