Setting StandardEditorConfiguration Programatically

Posted by Community Admin on 03-Aug-2018 16:28

Setting StandardEditorConfiguration Programatically

All Replies

Posted by Community Admin on 24-Jan-2012 00:00

I want to be able to set the StandardEditorConfiguration property programatically, and it looks like it should be publically accessible (see www.sitefinity.com/.../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

Posted by Community Admin on 27-Jan-2012 00:00

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

Posted by Community Admin on 06-Feb-2012 00:00

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 www.sitefinity.com/.../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.

Posted by Community Admin on 06-Feb-2012 00:00

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

Posted by Community Admin on 13-Mar-2015 00:00

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.

Posted by Community Admin on 13-Mar-2015 00:00

Figured it out. In case it helps anyone else, I resolved the error by firing it from the PreApplicationStartMethod.

This thread is closed