宁静网格不翻译 lookupeditor

Serenity grid not translating lookupeditor

我是 serenety 的新手,并按照 serenity 指南在字段上创建了一个 lookupeditor。这在表单编辑器中工作正常,但在网格中却不行。网格不会将数值转换为文本。这是我的代码:

[函数行]

[DisplayName("Cargo"), ForeignKey("[Ipss].FuncionariosCargos", "Codigo"), LeftJoin("f")]
[LookupEditor(typeof(FuncionariosCargosRow), InplaceAdd = true)]
public Int32? Cargo
{
    get { return Fields.Cargo[this]; }
    set { Fields.Cargo[this] = value; }
}

[FuncionariosCargosRow]

...
[JsonConverter(typeof(JsonRowConverter))]
[LookupScript("IpssDB.FuncionariosCargos")]
public sealed class FuncionariosCargosRow : Row, IIdRow, INameRow
{
...
}

在表单中,您有带有查找编辑器的 int 字段,它显示查找文本值并在后面发送 int 值。当您在行字段上添加 lookupeditor 时,它充当表单的默认编辑器类型。您可以从 XyzForm.cs

覆盖它

在网格中您没有编辑器类型。所以你直接看到 int 值。如果int值有join,可以用joined text field代替id。