All posts

RadControls and ASP.NET Dynamic Data - Part Deux

It seems that I've managed to mess things up in my previous blog post. The sample web site and user controls work but ... they are using the December CTP release of ASP.NET Dynamic Data! Kudos to Scott Hunter for spotting the problem. It seems that albeit I installed the latest Dynamic Data bits I forgot to uninstall the December CTP and Visual Studio 2008 was still using the old Web Site template. Be careful when installing the new bits - uninstall any previous releases first!

The sample web site and field template user controls have been updated. Please download it from here. Keep in mind that the RenderHint attribute is replaced by the UIHint attribute. The semantics of using that attribute have also changed. Now you need a MetaDataType object on which you apply the UIHint attribute. Here is the modified code for the Order object:
[MetadataType(typeof(OrderMetadata))] 
public partial class Order 
 
 
public class OrderMetadata 
    [UIHint("DateTimeTelerik")] 
    public object OrderDate { getset; } 
 
    [UIHint("DateTimeTelerik")] 
    public object RequiredDate { getset; } 
 
    [UIHint("DateTimeTelerik")] 
    public object ShippedDate { getset; } 
 
    [UIHint("ForeignKeyTelerik")] 
    public object Customer { getset; } 
 
    [UIHint("ForeignKeyTelerik")] 
    public object Employee { getset; } 
 
    [UIHint("IntegerTelerik")] 
    [Range(1, 3)] 
    public object ShipVia { getset; } 
 
    [UIHint("DecimalTelerik")] 
    public object Freight { getset; } 
 
    [UIHint("TextTelerik")] 
    public object ShipName { getset; } 
     
    [UIHint("TextTelerik")] 
    public object ShipAddress { getset; } 
     
    [UIHint("TextTelerik")] 
    public object ShipCity { getset; } 
     
    [UIHint("TextTelerik")] 
    public object ShipRegion { getset; } 
     
    [UIHint("TextTelerik")] 
    public object ShipPostalCode { getset; } 
 
    [UIHint("TextTelerik")] 
    public object ShipCountry { getset; } 
 


Post a comment!
  1. Security image