Consolas Font for Visual Studio 2005

At Tech Ed this year, the presenter at one of the Windows Presentation Foundation talks was raving about the new Consolas ClearType font was was recently developed for Visual Studio 2005. I have downloaded it and I must say it is the best fixed width developer font I have ever seen. Here is an example screen shot (although my screen shot really does not do it justice): You can download the font for free here: http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3...


Visual Studio Magazine Article on Validating Business Objects

I just had an article published in the June issue of Visual Studio magazine. http://www.visualstudiomagazine.com This is my first time in “print”! The direct link to my article is: https://visualstudiomagazine.com/Articles/2006/06/01/Validate-Business-Objects-Declaratively.aspx A couple of people had trouble downloading the code from the VSM site so I'm happy to provide directly. The article essentially presents a flexible framework for validating business objects utilizing attributes....


GridView - Set column properties at run-time

An interesting issue came up today that, although it now looks simple, did not have an immediately obvious solution. Specifically, what if you want to set properties of individual columns of a GridView at run-time (via C# code) rather than at design time in the aspx code. For example, let's say you want to set the DataFormatString property of a BoundField column. In short, it is a 2-part solution. First, you must positionally extract your column out of the GridView's Columns property while cast...


Real world example of C# Anonymous Methods

Often when a new language features come out (in this case anonymous method) we often see syntax examples like this: delegate void SomeDelegate(); public void InvokeMethod() { SomeDelegate del = delegate() { MessageBox.Show("Hello"); }; del(); } and we say, great but when is code like THAT ever going to be useful to me? In that trivial example, of course that's not very useful. But when you consider the power anonymous methods gives you both to pass...


ASP.NET 2.0 GridView FormatStrings

You can supply format strings to the columns in your GridView by setting the DataFormatString property of the column to something like this: "{0:d}". However, you may have run across a case where you set this property and the system does not recognize the format string you provided. To make this work, you need to set the HtmlEncode property of that column to "False". Then the DataFormatString will act as expected when displayed at run-time....