宁静网格未转换Lookupeditor

问题描述

我对宁静并不陌生,并遵循了宁静指南在现场创建了lookupeditor。这在表单编辑器中工作正常,但在网格中却不能。网格不会将numerica值转换为文本。这是我的代码

[FuncionariosRow]

[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值具有连接,则可以使用连接的文本字段代替id。