24 October, 2011
0 Comments
1 category
I was trying to change the displayname of a field in a dataform by placing the DisplayName attribute on the property in the metadata class. This will not work instead you must use the [Display(Name= "This is the correct display name")] attribute on the field in a metadata class:
[MetadataTypeAttribute(typeof(Product.ProductMetadata))] public partial class Product { internal sealed class ProductMetadata { // Metadata classes are not meant to be instantiated. private ProductMetadata() { } public int Id { get; set; } [Display(Name = "First Name", Description = "Employee's first name")] //Correct ! //[DisplayName("First name 2")] // Wrong! public string Name { get; set; } public EntityCollection<ProductTag> ProductTag { get; set; } } }
Tags: RIA ServicesSilverlight
Category: Uncategorized