+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Setting StandardEditorConfiguration Programatically

Setting StandardEditorConfiguration Programatically

6 posts, 0 answered
  1. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    24 Jan 2012
    Link to this post
    I want to be able to set the StandardEditorConfiguration property programatically, and it looks like it should be publically accessible (see http://www.sitefinity.com/40/help/developers-guide/p_telerik_sitefinity_web_configuration_appearanceconfig_standardeditorconfiguration.html), but when I try to access it in Visual Studio IntelliSense isn't picking it up. Am I missing something here?

    Thanks,
    Chris Aumiller
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    06 Dec 2016
    27 Jan 2012
    Link to this post
    Hello Chris,

    You can work with the Config manager and get the specific section, and then get/set the values of specific entries there. For example:
    var mySection = Config.Get<AppearanceConfig>();
    mySection.StandardEditorConfiguration= "~/test.xml";
    Config.GetManager().SaveSection(mySection);



    Kind regards,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    06 Feb 2012
    Link to this post
    Boyan,

    I continue to get errors because now VS is not recognizing the AppearanceConfig class. I'm having trouble finding the Class Reference on the website (previously I had a bookmark for http://www.sitefinity.com/40/help/developers-guide/introduction.html, but it appears this has moved and I can no longer find it) to look up the correct namespace.

    Thanks,
    Chris Aumiller

    ETA: Thought I might have found it in another issue, but AppearanceSection does not live in Telerik.Sitefinity.Services like SystemConfig does.
  4. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    06 Dec 2016
    06 Feb 2012
    Link to this post
    Hi,

    Please find below the same sample with fully qualified namespaces resolved, I hope this helps you achieve the desired functionality:
    var mySection = Telerik.Sitefinity.Configuration.Config.Get<Telerik.Sitefinity.Web.Configuration.AppearanceConfig>();
                mySection.StandardEditorConfiguration = "~/test.xml";
                Telerik.Sitefinity.Configuration.Config.GetManager().SaveSection(mySection);


    Kind regards,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Mike
    Mike avatar
    3 posts
    Registered:
    10 Mar 2014
    13 Mar 2015 in reply to Boyan Barnev
    Link to this post

    Hi Boyan, I'm getting this error when trying implement your solution:
    Telerik.Sitefinity.Security.Data.StaticRoot,
    Telerik.Sitefinity was not granted ChangeConfigurations in Backend for
    principals with IDs 00000000-0000-0000-0000-000000000000

    Any idea why this is happening / how to resolve?

    Thanks.

  6. Mike
    Mike avatar
    3 posts
    Registered:
    10 Mar 2014
    13 Mar 2015
    Link to this post
    Figured it out. In case it helps anyone else, I resolved the error by firing it from the PreApplicationStartMethod.
6 posts, 0 answered