AutoQueryGrid Lookup Column

Hi,
in the model I have a column

[References(typeof(Kontrolltype))]
public int TaskTypeId { get; set; }

No I want to show this column value with the lookup value of Kontrolltype in an AutoQueryGrid column.
How can I do this?

I can’t find any sample for this.

Alois

Do you have a AutoQuery Query API for Kontrolltype, i.e. that inherits from QueryDb<Kontrolltype>?

The Lookup Inputs are rendered for rendered for Reference Fields annotated with the [Ref] attribute which AutoQuery applies when it can infer the relationship, but each lookup uses the AutoQuery API for the referenced field which needs to exist.

I’m not quite sure what you mean.
I have an query api for Kontrolltype.
But how I manage the blazor view.
I only found samples with not reference columns (like entity booking) in combination with autoquery.

I thought you were referring to Vue AutoQueryGrid, but sounds like you’re referring to the Blazor AutoQueryGrid component, you’ll want to mention that in your new questions.

I don’t know what Blazor view you’re referring to, or really what you’re trying to achieve.

What documented Blazor AutoQueryGrid feature are you referring to?

I would recommend a sample for a featue in Blazor AutoQueryGrid with reference column like

[References(typeof(Kontrolltype))]
[Ref(Model = nameof(Kontrolltype), RefId = nameof(Kontrolltype.Id), RefLabel = nameof(Kontrolltype.Designation))]
public int TaskTypeId { get; set; }

Now in the razor view I want to customize the columns and espacially a lookup column. But how can I make this?

AutoQueryGrid Model=“Kontrolltermine” Apis=“Apis.AutoQuery<QueryTask,CreateTask,UpdateTask,DeleteTask>()”
AllowSelection=“true” AllowFiltering=“false”
RowSelected=“OnSelectedRow”>

“Columns>
Column Field=”(Kontrolltermine x) => x.TaskTypeId"> ???

This only show up the id of the foreign key.

The data must be returned in the API in order for the AutoQueryGrid component, which can be done by defining a Reference field with the model type using the [Reference] attribute:

public class MyClass 
{
    [References(typeof(Kontrolltype))]
    public int TaskTypeId { get; set; }

    [Reference]
    public Kontrolltype TaskType { get; set; }
}

Where you should be able to access its populated reference type:

<Column Field=”(Kontrolltermine x) => x.TaskType...">

The Talent Blazor application is a good example of annotated AutoQuery APIs in its Talent.cs AutoQuery DTOs which is used to render its default Locode AutoQueryGrid UI.