décembre 2008 - Posts

The Silverlight Tour is coming to Paris!
22 décembre 08 11:48 | Laurent Duveau

We at RunAtServer Consulting are bringing the Silverlight Tour to France!

If you are looking for a French-speaking training on Silverlight 2 this is your chance to learn it from soup to nuts!

See you there!

Filed under: ,
My Silverlight session at DevTeach Montreal
05 décembre 08 01:23 | Laurent Duveau

During my “Business oriented Silverlight 2 application” talk at DevTeach conference (december 2008) I used Visual Studio 2008 and Expression Blend to build an application that retrieves SQL server data (Beers!) through an Entity Framework model and exposes it to a Silverlight client via a WCF service and LINQ queries. I did some design and animation, added a ComboBox and DataGrid to display data and asynchronously update the model as users edit it. Then I showed how to use local cache on the client to optimize network traffic and finally applyed some Style to shape the UI.

I had only 2 slides in my ppt deck, and here is my funny slide #2:

I coded all that live on stage in 60 min without any errors!

As promised here is the source code of the application I built live:

Slides:

[Beers Db by Andy Beaulieu]

 

Technorati Tags:

Zune bag loves iPhone
04 décembre 08 08:59 | Laurent Duveau

Guess what’s inside my Zune bag…

…my iPhone!
The original Zune suede bag is way too small to fit the Zune but I found the perfect fit now!

Filed under: ,
Win an MSDN Premium Team Suite at DevTeach Montreal!
02 décembre 08 12:19 | Laurent Duveau

DevTeach Montreal

Attend one of the following session by RunAtServer Consulting folks and you could win an MSDN Premium Team Suite Subscription (yes, the FULL Top of the Top package at 14 000$):

  • Advanced ASP.NET Server Control - Dominic Sévigny – December 2 at 1:30pm Viger A room
  • Business Oriented Application with Silverlight 2 - Laurent Duveau – December 4 at 1:30pm Neufchatel room

See you there!!

Technorati Tags:

ASP.NET Dynamic Data: Customize a template field
01 décembre 08 01:23 | Laurent Duveau

Following my first post on ASP.NET Dynamic Data, I want to show you that you can customize existing fields used by Dynamic Data very easily.

With the Northwind db, here is the generated edit screen for the Employees table:

 

We could make this default user experience a lot better by changing the date input, why not add some AJAX here ?

Template fields used by Dynamic Data are stored in DynamicData/FieldTemplates folder as simple user controls:

You can see that there is a DateTime_Edit.ascx control, open it and add an Image for the calendar icon and a CalendarExtender from the ASP.NET AJAX Control Toolkit.

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:TextBox ID="TextBox1" runat="server" CssClass="droplist" Text='<%# FieldValueEditString %>' Columns="20" /> 
<asp:Image ID="imgCalendar" runat="server" ImageUrl="~/DynamicData/Content/Images/calendar.png" />
<ajax:CalendarExtender runat="server" TargetControlID="TextBox1" PopupButtonID="imgCalendar" />
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }


Now you get:

The calendar looks weird due to some CSS applied to the DetailsView. A quick workaround is to remove the CssClass attribute from the DetailsView1 control in DynamicData/PageTemplates/Edit.aspx :

Doing that (or fixing the CSS in Site.css file) will make the calendar looks good:

Note that the field is still fully functional without adding code, in a next post I will show how to create a new template field.

Source code:

 

Technorati Tags: