Resource field

Posted by Community Admin on 05-Aug-2018 15:40

Resource field

All Replies

Posted by Community Admin on 06-Jun-2011 00:00

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

Posted by Community Admin on 09-Jun-2011 00:00

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 >>

This thread is closed