November 2005 - Posts

Ready Launch Tour 2005 - Melbourne Quick Review

Last Thursday (Thursday November 24th) was the Melbourne Ready Launch Tour at the Sofitel Hotel in Melbourne. Registration opened at 9 AM for a 10 AM keynote, and after I arrived at around 9:30 AM I sat in the hotel's foyer to eat breakfast and check the show bag swag.

Inside the showbag were (from memory) some advertising brochures/magazines, a Microsoft pen, and a notepad; also floating around during the day was a complimentary International Developer magazine and some information on certification. There were about 10 or 12 vendors with stalls and some giveaways (I collected a radio and calculator, and was the envy of at least one of my geek friends). During the day, some of the vendors ran "cabana" infomercial sessions demonstrating their products.

The keynote featured short, to-the-point presentations by various Microsoft Australia (and some overseas) staff and videos on how companies were using the newly-released SQL Server 2005 and Visual Studio 2005. After the keynote, the sessions were broken up into Data Platform and Developer tracks which people were free to mix and match. There were also Microsoft CRM and BI (Business Intelligence) events happening concurrently which I stumbled onto - a BI session on Balanced Scorecards was very interesting. One other session that stood out was the presentation on "Mission-Critical Systems with SQL Server 2005", where Nick Ward did the bulk of the talking and tag-teamed with Dave Lean who showed how the technology worked, extensively using virtual machines.

On handing in the evaluation forms at the end of the day, we were given a "Ready to Launch" DVD kit which contained 4 DVDs worth of Hands-On Labs and a resource DVD, along with an exam voucher for the new certifications. I notice that on the "Resources" DVD are the session PowerPoint slides - they may have been prepared earlier and then presented at the different Launch events by different people (perhaps this helped dull my sense of "I'm getting something special by being at the launch event"...)

Overall the day was good and worthwhile, especially meeting up with people and "talking shop" over lunch. The highlight, session-wise, was the Balanced Scorecard session I mentioned above - which covered business strategy and KPI's and no code at all - perhaps I'd never thought about that kind of stuff before and so was interested by it. Having used Visual Studio for a couple of months, and attending many developer events in the last 6 months where the focus has been these new products, meant that a lot of the topics covered were not new to me. I had been expecting a lot from the presenters, and I was most interested in the code demos, but on reflection: how much can you learn in an hour? And especially when the emphasis is on the new features, rather than solid, world-ready code.

The Australian Ready Launch Portal can be found at http://www.microsoft.com/australia/readylaunch/.

On a closing note, the train ride home was itself a big adventure. I'm glad I don't have to do that every day!

Access Unlimited RSS

One of the only MS Access-related things I still read is Garry Robinson's Access Unlimited Ezine. Garry has switched to a blog format, and his RSS feed can be found at:

http://www.vb123.com/news/rss1.xml

Even though I primarily work with SQL Server 2000 (although I came from an Access background as I've described here and here), I find Garry's musings interesting and concise enough to keep mt abreast of all the good Access/Office stuff. And he's Australian too! 

Lowest Common Denominator Applets

Jeff Atwood posts about applets that ship with the Windows OS, and suggests:

...isn't the fit and finish of little applets like these-- Notepad, Calculator, Character Map, Paint, Disk Cleanup, Compressed Folders, and dozens of others-- indicative of the care and design that goes into the entire operating system? If Microsoft can't be bothered to bundle a version of Notepad that has basic amenities like a toolbar, what hope does the rest of the operating system have?

Hear hear. Jeff makes a fair point here. Why do I have to replace Notepad on every Windows system I have, not because I'm super-picky but because Notepad is basically the lowest common denominator of text editing? And then why do I have to understand Notepad anyway, because everyone else uses it?

Microsoft can't just go and buy better versions of applets, I know, but getting a reasonable image editor, video player and text editor (word processor lite, or whatever) bundled with the OS can't be asking too much, right?

Adding a sort direction image to a GridView's header - ASP.NET 2.0

The ASP.NET 2.0 GridView control has a simple property called "AllowSorting" which makes it easy for end-users to click a column header (rendered as a link when the "AllowSorting" property is set to "True") and sort to their heart's content - a second click on a sorted column even sorts in descending order. However, I reckon the built-in functionality is missing an image or glyph or something to show that the column has been sorted.

I notice there's a few articles on adding a sort direction image to a header cell in an ASP.NET 2.0 GridView, but I wanted to write about a simple method I came up with that uses the Webdings font (and no images...OK, so the title of this post is a little misleading). This technique works well for me now because a) its impact on the page's code is minimal and b) it uses a font for now, but eventually it could use an image.

In the GridView's "Sorting" event, add the code:

        AppendSortOrderImageToGridHeader(e.SortDirection, e.SortExpression, [gridname])

And here's the code for "AppendSortOrderImageToGridHeader", which I have put in a class in the "App_Code" folder:

        ''' <summary>
        ''' Append a sort indicator (in this case, a symbol in Webdings font) based on
        ''' the sort expression and direction that are passed to the correct column header
        ''' in the passed grid. 
        ''' </summary>
        ''' <param name="sortDir">Sort direction - either ascending (<c>SortDirection.Ascending</c>) or descending (<c>SortDirection.Descending</c>).</param>
        ''' <param name="sortExpr">Sort expression which is a database field.</param>
        ''' <param name="grid">ASP.NET GridView control.</param>
        ''' <remarks><para>Called from a grid's "Sorting" event, e.g. <code>AppendSortOrderImageToGridHeader(e.SortDirection, e.SortExpression, [gridname])</code>.</para></remarks>
        Public Shared Sub AppendSortOrderImageToGridHeader(ByVal sortDir As System.Web.UI.WebControls.SortDirection, _
                ByVal sortExpr As String, _
                ByRef grid As System.Web.UI.WebControls.GridView)

            ' looping variable 
            Dim i As Integer
            ' did we find the column header that's being sorted?
            Dim foundColumnIndex As Integer = -1

            ' constants for sort orders
            Const SORT_ASC As String = "<span style='font-family: Webdings; '> 5</span>"
            Const SORT_DESC As String = "<span style='font-family: Webdings; '> 6</span>"

            ' get which column we're sorting on
            For i = 0 To grid.Columns.Count - 1
                ' remove the current sort
                grid.Columns(i).HeaderText = grid.Columns(i).HeaderText.Replace(SORT_ASC, String.Empty)
                grid.Columns(i).HeaderText = grid.Columns(i).HeaderText.Replace(SORT_DESC, String.Empty)
                ' if the sort expression of this column matches the passed sort expression, 
                ' keep the column number and mark that we've found a match for further processing
                If sortExpr = grid.Columns(i).SortExpression Then
                    ' store the column number, but we need to keep going through the loop
                    ' to remove all the previous sorts
                    foundColumnIndex = i
                End If
            Next

            ' if we found the sort column, append the sort direction 
            If foundColumnIndex > -1 Then
                ' append either ascending or descending string
                If sortdir = SortDirection.Ascending Then
                    grid.Columns(foundColumnIndex).HeaderText &= SORT_ASC
                Else
                    grid.Columns(foundColumnIndex).HeaderText &= SORT_DESC
                End If

            End If

        End Sub

The code in "AppendSortOrderImageToGridHeader" loops through all the columns headers, once, to remove any previous sort "image" and to also find the column that is being sorted. Then it adds either an ascending or descending Webdings character to the column that's being sorted.

I'm only two months into the project, and still learning ASP.NET, but perhaps as time goes on I may switch to the ASP Alliance article which extends the GridView to add a SortDescImageUrl and SortAscImageUrl property.

As usual I make no guarantee that this code is going to work outside my alternate reality...but, I hope you find it useful!