This is a migrated thread and some comments may be shown as answers.

RadCalendar TemplateItem

2 Answers 74 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Kevin Fisk
Top achievements
Rank 1
Kevin Fisk asked on 08 Apr 2008, 03:36 PM

I am trying to figure out how to access the width property of a particular day element.

I am using the scheduler theme and using a radhostitem within a specialday in order to display a listbox with a clickable list of items for that date. I need to find a way to programatically set the width of the controls or else they interfere with the underlying cell. Or is there an easier way of implementing this functionality???

Dim c As New RadPanel

Dim tmpLabel As New Label
tmpLabel.BackColor = Color.Transparent
tmpLabel.Width = 75 ''''' THIS IS WHERE I NEED TO FIND DIMENSIONS OR MAYBE FOR THE RADPANEL ITSELF
tmpLabel.Text =
Me.RadCalendar1.SpecialDays(0).Date.Day
c.Controls.Add(tmpLabel)

Dim tmpList As New ListBox
tmpList.Width = 90  ''''' THIS IS WHERE I NEED TO FIND DIMENSIONS
tmpList.Height = 90tmpList.Font =
New System.Drawing.Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular)tmpList.BorderStyle = BorderStyle.None

tmpList.Items.Add("TESTING")
tmpList.Items.Add(
"TESTING2")
tmpList.Items.Add(
"TESTING3")

c.Controls.Add(tmpList)

c.Controls(1).Location =

New System.Drawing.Point(3, 10)

Dim myTemplateItem As New RadHostItem(c)
Me.RadCalendar1.SpecialDays(0).TemplateItem = myTemplateItem

2 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 11 Apr 2008, 01:26 PM
Hello Kevin Fisk,

Thak you for the question.

To get the Size property of a specific SpecialDay's underlying CalendarCellElement, traverse the CalendarTableElement collection and identify the cell by its Date property. I have attached a sample application which demonstrates the approach.

If you have additional questions, do not hesitate to contact me.

Best wishes,
Nikolay
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Kevin Fisk
Top achievements
Rank 1
answered on 15 Apr 2008, 03:51 PM
Thanks!!!

Kevin
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Kevin Fisk
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Kevin Fisk
Top achievements
Rank 1
Share this question
or