Deliver superior customer experiences with an AI-driven platform for creating and deploying cognitive chatbots
Deliver Awesome UI with the most complete toolboxes for .NET, Web and Mobile development
Automate UI, load and performance testing for web, desktop and mobile
A complete cloud platform for an app or your entire digital business
Detect and predict anomalies by automating machine learning to achieve higher asset uptime and maximized yield
Automate decision processes with a no-code business rules engine
Optimize data integration with high-performance connectivity
Connect to any cloud or on-premises data source using a standard interface
Build engaging multi-channel web and digital experiences with intuitive web content management
Personalize and optimize the customer experience across digital touchpoints
Build, protect and deploy apps across any platform and mobile device
Rapidly develop, manage and deploy business apps, delivered as SaaS in the cloud
The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
The ability to add custom fields to an existing content module in Sitefinity CMS provides flexibility to achieve a various range of scenarios.
One of these fields is the Choice Field. It allows users to select one of the predefined values, which can later be accessed via code, and, for example, provide filtering based on this field on the frontend. However, if we want to have a drop down containing all the possible values of the field, they need to be hardcoded manually.
To avoid doing this and to prevent typos, we can use the API to tap directly into the definitions and pull all the values from there, allowing us to bind them to a drop down for example.
First, we need to get one of the backend views (Edit/Insert) and from there we will have access to the CustomFieldsSection and the field we are after.
var conf = Config.Get<LibrariesConfig>();
var viewDef = conf.ContentViewControls[
var section = viewDef.Sections[
var mcFieldDefinition = section.Fields[
var choices = mcFieldDefinition.Choices;
> collection =
Dropdownlist1.DataSource = collection;
Stanislav Velikov is a Tech Support Engineer at Telerik. He joined the Sitefinity Support team in April 2011.
Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.