Now a lot of people hate it, but I think the PropertyGrid is cool - excellent for quick generation of edit UI. We have shown it to customers as part of prototype build, and they have asked for its inclusion! I was using the PropertyGrid to define a really simple editor for some data types and was working really well until I made the DateTime properties Nullable.
public virtual DateTime? EndDate
{
get { return m_endDate; }
set { m_endDate = value; }
}
The PropertyGrid was not displaying the editor, bit of a bummer! Although not a massive deal, I thought I was going to need to create a UITypeEditor that would cope with Nullable dates. Fortunately if you are explicit, the built in editor supports a Nullable DateTime.
[EditorAttribute(typeof(DateTimeEditor), typeof(UITypeEditor))]
public virtual DateTime? EndDate
{
get { return m_endDate; }
set { m_endDate = value; }
}
Adding the EditorAttribute specifying the DateTimeEditor to the property forces the use of the built in editor for the Nullable type.
After checking out a Visual Studio 2008 solution from our Subversion repository to a new machine (and new physical location) I started getting failure on the post build event reporting an exit code of 9009. As ever it was building fin on another machine (luckily for once this failure wasn't on the continuous integration server).
With an exception like that It would have been easy to go off on one! This project had some post build processing running in batch file, including RegAsm! Looking at the simple things first, it had been checked out to a location with long file names such that the batch file was not running correctly.
$(ProjectDir)\Install\Install.cmd
Just wrapping the command in quotes sorted it.
"$(ProjectDir)\Install\Install.cmd"
Ridiculously simple I know, but I thought I would write this one up - the way this was reported you could easily burn an hour or so chasing your tail...