Hello,
Kentico CMS 6.0 stores this options in different format. Therefore, you will need to parse the string, as it demonstrated here:
DataClassInfo info = DataClassInfoProvider.GetDataClass("<class name>");
if (info != null)
{
CMS.FormEngine.FormInfo fi = new CMS.FormEngine.FormInfo(info.ClassFormDefinition);
CMS.FormEngine.FormFieldInfo ffi = fi.GetFormField("<field name>");
string options = ValidationHelper.GetString((ffi.Settings["options"]), String.Empty);
options = options.Replace(FormHelper.SEMICOLON_TO_REPLACE, FormHelper.REPLACED_SEMICOLON);
string[] lines = options.Split(new string[] { Environment.NewLine, "\n" }, StringSplitOptions.RemoveEmptyEntries);
if (lines.Length > 0)
{
string text;
string value;
foreach (string line in lines)
{
// Insert hidden semicolons
value = line.Substring(0, line.IndexOf(";"));
value = value.Replace(FormHelper.REPLACED_SEMICOLON, ";");
text = line.Substring(line.IndexOf(";") + 1);
text = text.Replace(FormHelper.REPLACED_SEMICOLON, ";");
}
}
}
Best regards,
Michal Legen