0

FieldAttribute.Group属性在应用于集合时不起作用。在下面的示例中,在规则编辑器中,我得到了两个菜单项(组、其他)。在我得到的group菜单项MyField下,OTHER我得到MyCollectionOtherField。我希望groupMyFieldand MyCollection

public class MyModel
{
    [Field(Settable = false, Group = "group")]
    public int MyField { get; set; }

    [Field(Settable = false, Group = "group")]
    public List<int> MyCollection { get; set; }

    [Field(Settable = false)]
    public int OtherField { get; set; }
}

// here is how the editor is instantiated
RuleEditor editor = new RuleEditor("divRuleEditor")
{
   Mode = Common.RuleType.Execution,
   SourceType = typeof(MyModel)
};

在此处输入图像描述

4

0 回答 0