Conditional DataGrid Colum Property Value

In our data, we have six different address lines; NameAddress1... NameAddress6. In a DataGrid, we are attempting to display, and filter, data conditionally. Instead of having two columns, we would like to display one value or the other.

For example, if NameAddress4 is empty, display NameAddress2, otherwise display NameAddress3. We can display the appropriate data with a Template like this:

            <RadzenGridColumn Width="100px" TItem="RealEstate" Title="Mailing Address">
                <Template Context="display">
                    @(string.IsNullOrEmpty(display.NameAddress4) ? display.NameAddress2 : display.NameAddress3)

But, without the Property value set, we cannot filter. We tried adding a FilterTemplate, but could not make that work either. When we tried this:

<RadzenGridColumn Context="address" Width="100px" TItem="RealEstate" Title="Mailing Address" Property="@(string.IsNullOrEmpty(address.NameAddress4) ? display.NameAddress2 : display.NameAddress3)">
</RadzenGridColumn >

We get the error:
The name 'address' does not exist in the current context

I tried using a FilterTemplate with a dropdown of the values, but that was wonky because the data has several thousand rows.

Is there another possibility to display, and filter, the data?

I would create a new property of my model called Address and use that for filtering and displaying data:

public class RealEstate
     public string Address
            return string.IsNullOrEmpty(NameAddress4) ? NameAddress2 
                          : NameAddress3;
<RadzenGridColumn TItem="RealEstate" Title="Address" Property="Address">
</RadzenGridColumn >

Perfect, thank you Atanas! I just added the


annotation to the model. Though, we could also use a Computed column:


I will pass this along to the team. Such a simple solution, thanks again.