RadCalendar TemplateItem

3 posts, 0 answers
  1. Kevin Fisk
    Kevin Fisk avatar
    3 posts
    Member since:
    Apr 2008

    Posted 08 Apr 2008 Link to this post

    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. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 11 Apr 2008 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Kevin Fisk
    Kevin Fisk avatar
    3 posts
    Member since:
    Apr 2008

    Posted 15 Apr 2008 Link to this post

    Thanks!!!

    Kevin
Back to Top