This is my second article for Code Project, and it shares some of the implementation techniques of the previous article, so if you want some detail on the implementation of themes, nested properties, and Type Editors, check out my Moz Bar article.For information about how to edit and persist collections, check out Daniel Zaharia's excellent article. NET control, for using in the IDE, you should add the basically consists of five different regions, each with its own set of properties.I decided to write this control because I needed a month calendar that's much more customizable and flexible than the standard Visual Studio Calendar, in one of my projects.My primary focus was the ability to add information (color, text, image etc.) to each day, and for this to work reasonably well, it must also be resizable.
If you for example are performing some validations based on the value of the source property and also are enabling or disabling controls or presenting some visual feedback to the user as a result of this validation logic, you probably want to perform the very same logic regardless of whether the user enters the new date using the calendar – the source property does get set as expected when a date is selected in the calendar – or by entering it directly in the Text Box.
You can only add static controls, like an Image or Hyper Link to the cell, nut not dynamic event raising controls like a Drop Down List or Button.
We also change the background color of the cell to draw more attention to the date.
// to simulate a database query social Events = new Data Table(); social Events. Add(new Data Column("Date", typeof(Date Time))); social Events. Add(new Data Column("Description", typeof(string))); social Events. Let’s take a look at the event handler for the Day Render event.
Our first step is to find out if there are any events for the current date.