How to reference another class in radzendatagrid

Hello everyone, I hope you are doing great,

I'm using radzendatagrid and I'm trying to show the contents of a class of a RadzenDataGridColumn. In particular I want to iterate the user class and also show its corresponding role class. However when I try to reference the class role within user it incorrectly shows the user's id. I also tried showing the description, but it simply returns the class name. This is the code:

UserOverviewPage.razor:

@page "/useroverview"
@using SkillMatrix.APIModels.Models;

Users

@if (Users == null)
{

Loading ...


}
else
{






        <RadzenDataGridColumn TItem="UserResponse">
            <Template Context="selected">
                <RadzenButton Icon="info" ButtonStyle="ButtonStyle.Info" Click=@(() => NavigateToDetailPage(selected))>
                </RadzenButton>
                <RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Click=@(() => NavigateToEditPage(selected))>
                </RadzenButton>
            </Template>
        </RadzenDataGridColumn>
    </Columns>

</RadzenDataGrid>

}

UserRoleOverviewPage.cs:

using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using SkillMatrix.APIModels.Models;
using SkillMatrix.Client.Services.Interfaces;

namespace SkillMatrix.Client.Features.UserRoleView
{
    public partial class UserRoleOverviewPage
    {
        #region protected properties
        protected IEnumerable<UserRoleResponse> UserRoles { get; set; }

        [Inject]
        protected IUserRoleDataService UserRoleDataService { get; set; }

        [Inject]
        public NavigationManager NavigationManager { get; set; }

        #endregion

        #region protected methods
        protected override async Task OnInitializedAsync()
        {
            UserRoles = await UserRoleDataService.GetUserRolesAsync();
        }

        protected void NavigateToDetailPage(UserRoleResponse userRole)
        {
            NavigationManager.NavigateTo($"userroledetail/{userRole.Id}");
        }

        protected void NavigateToEditPage(UserRoleResponse userRole)
        {
            NavigationManager.NavigateTo($"userroleedit/{userRole.Id}");
        }

        #endregion
    }
}

UserResponse.cs:

namespace SkillMatrix.APIModels.Models
{
public class UserResponse
{
public int Id { get; set; }

    public string Name { get; set; }
    
    public string Password { get; set; }
    
    public string PhoneNumber { get; set; }
    
    public string Email { get; set; }
    
    public string ErrorMessage { get; set; }
    
    public virtual UserRoleResponse Role { get; set; }
}

}

UserRole.cs:

using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace SkillMatrix.Shared.Entities
{
public class UserRole
{
public int Id { get; set; }

    [Required]
    [StringLength(50, ErrorMessage = "Description is too long.")]
    public string Description { get; set; } = null!;

    public virtual ICollection<User> Users { get; set; } = new HashSet<User>();
}

}

If there is a relationships between both tables Radzen will generate reference property. For example Northwind Order class will have Custom property populated from CustomerID:

Such related properties are populated using $expand parameters and later you can access them in DataGrid column template. For example:

Sorry, I've posted this in the wrong section again. I'm using blazor components. Can someone move this to the appropriate section? Otherwise I'll post it there again. Thanks for your time!

The second part of my reply is related to Radzen Blazor components and how to show relationships in templates. If you do not use Radzen IDE you should create your own model representing the relationship. You do not need to open separate topic.