Scott Hanselman

ATTN Portlanders - Pioneer Courthouse Square launched their new site

June 18, 2004 Comment on this post [2] Posted in Musings
Sponsored By

Hey Portland folks, Pioneer Courthouse Square - Portland's Living Room - launched their new site today.

I did their BrickFinder application in C# and VB.NET a while back as a demo application.  They had the whole thing in Excel until they hit the old 64,000 row limit.  They upsized to Access 2.0 and went on their merry way.  I updated them to VB6 about 7 years ago, and .NET last year.  This recent face lift was easy, and for me just involved stylesheet changes and no major recompiles.  It includes caching and a dynamically generated map of the square with your personalized brick highlighted.

If you are ever in Portland, check out the Elvis Brick. :)

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Ten Must-Have Tools Every Developer Should Download Now - Should be named: "...should know how to use"

June 18, 2004 Comment on this post [1] Posted in NUnit | Tools
Sponsored By

James Avery has a great article up in MSDN Mag called Ten Must-Have Tools Every Developer Should Download Now.  He's right.  Although, I'd have named it Ten Must-Have Tools Every Developer Should Know How To Use

It's a very good article that reminds us that world of Windows Programming has changed, and it's about more tools than just Visual Studio.NET.  I'm continually surprised at the number of folks that haven't even heard of NUnit.  I look forward to the tools to come!

I'll need to check my list of Ultimate Tools and make sure all these are on it!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

How do I automatically size (autosize) Columns in a WinForms DataGrid?

June 18, 2004 Comment on this post [19] Posted in Programming
Sponsored By

Apparently this is, like, the problem for the ages or something, but noone on this planet has come up with a way to automatically size the columns in a DataGrid.  Sure, there's all sorts of pyscho ways that involve measuring the length of strings in DataSets with the Graphics context, yada yada.  But, since I'm binding strongly-typed Object Collections to DataGrids in WinForm apps, that doesn't work for me (and it's a little over the top, IMHO).

So, I thought about it like this:

  • If you double click on the little splitter between columns they will autosize.
  • Therefore, the code to autosize has been written for me; no need to measure strings, etc.
  • How do I force a double click? No, wait, wrongheadedness, how do I call whatever THEY call when a double click happens?
  • So, I reflectored into DataGrid.OnMouseDown and saw their custom HitTest calls a private ColAutoResize.  Ah, bingo.

If you're going to 'sin' do it with style - do it with Reflection.

private void dgLogging_DataSourceChanged(object sender, System.EventArgs e)
        {
            try
            {
                Type t = dgLogging.GetType();
                MethodInfo m = t.GetMethod("ColAutoResize",BindingFlags.NonPublic);

                for (int i = dgLogging.FirstVisibleColumn; (i < dgLogging.VisibleColumnCount); i++)
                {
                    m.Invoke(dgLogging, new object[]{i});
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.Write("Failed Resizing Columns: " + ex.ToString());
            }
        }

(Thanks to Patrick Cauldwell for his help)

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

RSS Feed to dasBlog Content Converter

June 18, 2004 Comment on this post [2] Posted in ASP.NET | DasBlog | Nant | XML | Tools
Sponsored By

Greg Hughes once had a LiveJournal Blog and the only remnant of his blog was an RSS Feed/Archive.  Now that he runs dasBlog he wanted to move his old content foward into dasBlog.  So, we googled a bit and couldn't find a tool that would take an RSS (2.0) feed as input and put the entries into dasBlog.

So we made one over lunch, and here it is: RSStoDasBlog.zip (219.29 KB)

RSStoDasBlog.exe MyRssFile.xml "C:\documents and settings\whatever\dasblog\content"

Use it like this by pointing it to the RSS file and your (local) dasBlog content folder.  It will create all the needed dayentry.xml files for you to upload to your remote blog.  It will also (I think) take an http:// url to an RSS file and could be used to (possible as a service?) steal RSS and mirror them in dasBlog.  Thanks to Jerry (Chris) Maguire's RSS Framework that showed up first in Google and saved me the time of running XSD.exe on an RSS XML schema. Apparently he has even newer stuff on his site.  It's got a few more moving parts than I think it needs to, but it did the job with a few changes that I marked with my initials; SDH.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Windows XPSP2 RC2 on the TabletPC doesn't work in FireFox 0.9? *GASP*

June 17, 2004 Comment on this post [4] Posted in Musings
Sponsored By

Apparently the TIP (TabletPC Input Panel) in Windows XP SP2 RC2 doesn't detect the TextBoxes in FireFox 0.9?  Is anyone else seeing this egregious behavior?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.