Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Customize the Calendar Control

Customize the Calendar Control

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-netdatabase
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RX Maverick
    wrote on last edited by
    #1

    I have a database full of dates and events for a calendar. I can (and have, using ASP) created my own code to create and fill out a Calendar. Before I review my code and rewrite it using ASP.NET/VB.NET I want to make sure I can't use the Calendar control already provided. I need to have two views for this, the first looks like the basic calendar control but with a color code for repeating dates. Like say the Jan. 12th is Martin Luther King Jr. Day, I would like it's background yellow (basically have style="background-color:yellow" in the TD tag). The second need I have is to have a big calendar with actual text in the box, so on the 12th the text "Martin Luther King Jr. Day" would be in the box with the date. So the basic question is: Is there anyway to programmatically access the individual date cells?

    M 1 Reply Last reply
    0
    • R RX Maverick

      I have a database full of dates and events for a calendar. I can (and have, using ASP) created my own code to create and fill out a Calendar. Before I review my code and rewrite it using ASP.NET/VB.NET I want to make sure I can't use the Calendar control already provided. I need to have two views for this, the first looks like the basic calendar control but with a color code for repeating dates. Like say the Jan. 12th is Martin Luther King Jr. Day, I would like it's background yellow (basically have style="background-color:yellow" in the TD tag). The second need I have is to have a big calendar with actual text in the box, so on the 12th the text "Martin Luther King Jr. Day" would be in the box with the date. So the basic question is: Is there anyway to programmatically access the individual date cells?

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      RX Maverick wrote:

      Is there anyway to programmatically access the individual date cells?

      There is. The ASP.NET Calendar control exposes an event called OnDayRender in which you can manipulate the look of individual day cells or add content based on the day. Here's a CP article[^] that uses OnDayRender. The article goes into some complexity - you might want to look up OnDayRender in MSDN too and look at the examples there.

      R 1 Reply Last reply
      0
      • M Mike Ellison

        RX Maverick wrote:

        Is there anyway to programmatically access the individual date cells?

        There is. The ASP.NET Calendar control exposes an event called OnDayRender in which you can manipulate the look of individual day cells or add content based on the day. Here's a CP article[^] that uses OnDayRender. The article goes into some complexity - you might want to look up OnDayRender in MSDN too and look at the examples there.

        R Offline
        R Offline
        RX Maverick
        wrote on last edited by
        #3

        That's a great article with a lot of good information but now I have a second problem. I would like to use this with AJAX but in doing so I can't have it in a form element. I understand it wants the for element to handle the postbacks and such but I don't need that all I need is regular links. So can I tell the calendar to not use postback/forms or should I just make my own system?

        M 1 Reply Last reply
        0
        • R RX Maverick

          That's a great article with a lot of good information but now I have a second problem. I would like to use this with AJAX but in doing so I can't have it in a form element. I understand it wants the for element to handle the postbacks and such but I don't need that all I need is regular links. So can I tell the calendar to not use postback/forms or should I just make my own system?

          M Offline
          M Offline
          Mike Ellison
          wrote on last edited by
          #4

          RX Maverick wrote:

          I would like to use this with AJAX but in doing so I can't have it in a form element

          Really? I thought that could be done. You have the calendar in an UpdatePanel, which would be in a <form> element, right?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups