Hi,
you could use following API to get information about drop down list options (options is a code name of drop down list field):
DataClassInfo classInfo = DataClassInfoProvider.GetDataClass("cms.news");
FormInfo formInfo = new FormInfo(classInfo.ClassFormDefinition);
FormFieldInfo ffi = formInfo.GetFormField("options");
Hashtable options = ffi.Settings;
string valuesWinTextXML = options["options"].ToString();
In case the option of drop down list are defined as:
1;One
2;Two
the code returns string "<item value=\"1\" text=\"One\" /><item value=\"2\" text=\"Two\" />"
Then you could use for example XMLHelper to parse above xml string.
Alternatively, inside your transformation you can define the switch which will assign text to values.
Example:
<script runat="server">
string GetName(object CodeName) {
if (CodeName != null) {
string Code = CodeName.ToString();
switch (Code) {
case "1": return "One";break;
case "2": return "Two"; break;
}
}
return (string)CodeName;
}
</script>
NumberString:<%# GetName(Eval("options")) %>
Best regards,
Ivana Tomanickova