October 2007 - Posts
This is a simple technique but one I've used a couple of times before. I thought I would post about it just for completeness based on a recent link from Scott Guthrie to an article by Matt Berseth on Improving the Presentation of an Extra-Wide GridView. The technique presented in Matt's post seems like a good one, and I use something similar quite often, but I regularly combine it with the one that follows, where I add a scroll bar to a long grid to keep it's size (usually the width) fixed within the design. One common technique to doing this is to use an IFrame, but this is ugly, especially when the same effect can be achieved just using CSS.
Before we begin, here is a sample picture of a grid in the page with a CSS scrollbar:
To demonstrate the technique, I'm using a very simple databound GridView, as follows, but you can wrap any long area of the page similarly:
<asp:GridView ID="GridView1" runat="server"
... remaining code removed for brevity
</asp:GridView>
To get the scrollbars, wrap the content in a containing div element, then set the 'overflow' property to 'auto', as follows (I've just used an inline style for demonstration purposes, you can of course use a class, id, etc.):
<div style="overflow: auto; width: 120px; ">
<asp:GridView ID="GridView1" runat="server"
... remaining code removed for brevity
</asp:GridView>
</div>
The 'width' setting is just to show it working. You can set height as well. There are also some other settings for the overflow property, but 'auto' should work best.
You can read more about the overflow tag here and here.
This sample was, of course, created using Visual Studio 2008 Beta 2, which shows the preview of the scrollbars perfectly as well ;-).
I picked up some goodies at Tech Ed for anyone that wants to collect. I've got a bunch of discs of
1) the Information Worker Resource DVD. It's got some stuff on for Unified Communications, SharePoint, Office Business Applications, Project 2007, Visio 2007 and general Office 2007 stuff (that's just reading off the cover, no idea what's inside yet - anyone played with it)?
2) Visual Studio 2008 Beta 2 - Yes, MS are finally putting these monster (1.5 GB) betas onto DVD for us.
If you want any of the discs, you can come collect from our offices in TygerValley (there's a map on the page too). However, I'm only giving the Beta 2 discs out after this month's S.A. Developer event, where I'll be talking on ASP.Net 3.5, so you have to come along to the talk to get 'em :-). Incidentally, if you're in the Western Cape and you haven't added yourself to our mailing list, please do so to get notified of what's coming up.
Incidentally, we've got a copy of the 2008 Beta VPC, but you probably don't want it after today anyway...
I've put my Tech Ed slides are up on my SkyDrive space. In sequential order, you can get them at:
1) DEV203 - What's New for ASP.NET Developers in Visual Studio 2008
2) DEV310 - Hidden Gems in ASP.NET 2.0
3) CNT207 - Windows Communication Foundation
[Update]
If you don't have access to PowerPoint at all, you can download the PowerPoint 2007 Viewer from Microsoft. Alternatively, if you have Office 2003, you can download the Microsoft Office Compatability Pack which will let you view and edit Office 2007 documents.
Expression Builder Class are a feature in ASP.NET 2.0 that enable you to inject compile-time values dynamically into your actual ASP.NET code itself. If they sound a little obscure, be aware you're probably using them already, especially if you use any of the Data Source controls or Resources properly - they're the '<%$' tags (note the Dollar sign). You can read more in this MSDN Magazine article.
I was building a custom Expression Builder today, and I noticed something I had not realised before. In retrospect, it is obvious, but it is important to note that Expression Builders are a compile-time feature. The value you need is looked up once, then cached in memory and not regenerated until the application recompiles. This is why an 'AppSettings' Expression Builder is a good idea, but one that fetches real-time stock quotes, for instance, like this:
<%$ StockQuote:ABC %>
is not a good idea.
As a 2nd free tip for the day: One of the out-of-box Expression Builders is the Resource option to localize your web app using resource files. If you want to use another source for the values, such as a database, don't write a new custom Expression Builder, rather Extend the ASP.NET 2.0 Resource-Provider Model
This is very creepy - it's hand soap...that's actually a hand! See here.
(found on http://mondays.pwop.com/)
We're playing with Team Foundation Server 2008 Beta 2 in the office at the moment. The features and improvements look good, but we've hit one or 2 little issues that we've had to resolve so I'm going to try blog a few of these in case others are having the same issues.
First up, the environment. We've got TFS 2008 Beta 2, running on a Virtual Server (VS) with the full TFS install local, the databases on another server, and a separate build VS. We've got 2 clients: a Vista 32 with VS 2005 and a Vista x64 with VS 2005 and VS 2008 Beta 2 and TFS clients for both as well. Tip number 1 - you have to install both clients separately so that each IDE has it's TFS client. Both can connect to the TFS 2008 server though (at least so far).
We've got a simple 2005 solution at the moment to test. It has a windows app, a web project, and a web application project. One snag we had was getting the build server to build a 2005 Web Application Project (remember, you had to download the Web Application Projects as a separate download in 2005. They're built in in 2008). The build fails, and the log complains that the "[path].csproj(61,11): error MSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk". To correct this, you can actually copy the folder off of a client machine "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v8.0" (or just "C:\Program Files\... - no "(x86)" - from the 32 bit machine) to the build server at C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0 and it should work fine.
Still not getting any output from the "web project" yet...