Serenity grid not translating lookupeditor

385 views Asked by At

I am new to serenety and followed the serenity guide to create a lookupeditor on a field. This works fine in the form editor but not in the grid. The grid does not translate the numerica value to text. Here is my code:

[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
{
...
}
1

There are 1 answers

1
Victor Tomaili On BEST ANSWER

In the form, you have int field with lookup editor which shows lookup text values and send int values behind. When you add lookupeditor on row field, its act as default editor type for forms. you can override it from XyzForm.cs

In the grid you dont have an editor type. so you see int values directly. If int value has join, you can use joined text field instead id.