Hello,
This information is stored as a part of field definition. Please take a look at the following code snippet that shows how you can get text/value pairs for a field:
DataClassInfo info = DataClassInfoProvider.GetDataClass("cms.user");
if (info != null)
{
CMS.FormEngine.FormInfo fi = new CMS.FormEngine.FormInfo(info.ClassFormDefinition);
// here you need to specify a field
CMS.FormEngine.FormFieldInfo ffi = fi.GetFormField(<field name>");
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
xmlDoc.LoadXml("<xml>" + Convert.ToString(ffi.Settings["options"]) + "</xml>");
System.Xml.XmlNode xmlNode = xmlDoc.FirstChild;
if (xmlNode.HasChildNodes)
{
// loop through all options
foreach (System.Xml.XmlNode itemNode in xmlNode.ChildNodes)
{
// get text/value pair
string text = CMSContext.CurrentResolver.ResolveMacros(XmlHelper.GetAttributeValue(itemNode, "text"));
string value = CMSContext.CurrentResolver.ResolveMacros(XmlHelper.GetAttributeValue(itemNode, "value"));
}
}
}
I hope this will help you.
Best regards,
Michal Legen