Resource field - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Resource field

  • Resource field
  • Hi,

    Just a quick question about resource properties:
    Following this code:

    var addressSection = new ContentViewSectionElement(detailView.Sections)
                    Name = "AddressSection",
                    Title = "AddressSection",
                    ResourceClassId = typeof(CompaniesResources).Name,
                    CssClass = "sfExpandableForm",
                    ExpandableDefinitionConfig = Expanded = true
                ;

    Which property do I have to use in my resource class as the key of the resource? I expect it to be the 'Name' property, but that doesn't work.

    Regards,
    Daniel
  • Hi Daniel ,

    Yes, you should use the name

    typeof(TypeResources).Name

    TypeResourcesis the type, but the key might me

    The custom resource class should have the following attribute

    [ObjectInfo("TypeResources", ResourceClassId = "TypeResources", TitlePlural = "TypeResourcesTitlePlural")]
        public sealed class TypeResources: Resource\


    where you have resource entries

            [ResourceEntry("ControlsTitle",
                           Value = "Fields",
                           Description = "The title of the toolbox for designing items.",
                           LastModified = "2011/05/20")]
            public string ControlsTitle
           
                get
               
                    return this["ControlsTitle"];
               
           

       
            [ResourceEntry("ControlsDescription",
                           Value = "A collection of reusable fields.",
                           Description = "The description of the toolbox for designing items.",
                           LastModified = "2011/05/20")]
            public string ControlsDescription
           
                get
               
                    return this["ControlsDescription"];
               
           

            /// <value>Title plural for the items module.</value>
            [ResourceEntry(
                "TypeResourcesTitlePlural",
                Value = "Forms",
                Description = "Title plural for the module.",
                LastModified = "2011/05/01")]
            public string TypeResourcesTitlePlural
           
                get return this["TypeResourcesTitlePlural"];
           

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>