How to send a picture through Windows Live Messenger without starting photo sharing.

Problem:

We all know this! Just drag the picture to the chat window to send it to your buddy. Oh no! Windows Live Messenger starts the horrific feature called photo sharing! This clutters up the chat window and renders it completely useless. If some how you could just avoid this hidious feature.

Solution:

Even though Windows Live Messenger does not allow you to turn the feature off, a quick n' dirty shortcut for sending files is right around the corner. Instead of dragging the file to the chat window, drag it onto your contacts name in the contact list. Voila! Ya good olde file transfer begins! Of course, you will have to open the contact list, but I can manage that.

Happy programming (and MSN'ing)!

How to make ASP.NET GridView use thead and tbody elements.

Problem:

You have an ASP.NET 2.0 GridView and would like to use printed media, but the GridView does not use <tbody> and <thead> elements, so you cannot print the header on each page.

Solution:

You make the GridView use <tbody> and <thead> elements by changing some properties. Like creating a method like the one below:



/// <summary>
/// Make the GridView use the thead and tbody elements.
/// </summary>
/// <param name="grid">The gridview in question.</param>
private void MakeGridViewPrinterFriendly(GridView gridView) {
    if (gridView.Rows.Count > 0) {        
        gridView.UseAccessibleHeader = true;
        gridView.HeaderRow.TableSection = TableRowSection.TableHeader;
    }
}


You can do the same thing with the FooterRow. I suggest you add this method to your web development framework.

To have IE print the table-header on each page you need to add the "display:table-header-group" to the <thead> element. The easiest way to do this is to wrap the table in a <div> element and associate it with a CSS class. Then you need to create a special case for the thead-elements used inside a div associated with that class:



.MyCssClass thead {
    display: table-header-group;
}


Use it like this:

<div class="MyCssClass">
    <table>
        <thead>
            ....


This post is based on information from this article: http://www.webpronews.com/expertarticles/2007/01/25/aspnet-make-gridview-control-accessible

Happy programming!