我有一个自定义表格,其中有几个字段具有列表选项供用户从添加内容时进行选择。在API中是否有某些东西允许我访问特定字段的选项,以便我可以在过滤小部件中使用这些相同的选项? 在Kentico 10自定义表中的字段的访问列表选项
像下面这样的东西,但适用于自定义表中的字段?
var guids = ParentDocument.GetValue("CustomFieldName").Split(';');
var referencedDocs = DocumentHelper.GetDocuments().WhereIn("DocumentGuid", guids);
UPDATE - 的情况下,该代码在回答修改链接:
protected string[] GetFormFieldOptions()
{
DataClassInfo dci = DataClassInfoProvider.GetDataClassInfo("custom.MyPageTypeName");
if (dci != null)
{
//Get the data from the form field
FormInfo fi = new FormInfo(dci.ClassFormDefinition);
FormFieldInfo ffi = fi.GetFormField("Industry");
string[] industries = ffi.Settings["Options"].ToString().Split('\n');
return industries;
}
return null;
}
该代码是我需要的!谢谢! –