How can i Sort or use a subclass as a property in a radzendatagrid column ? In my grid im using a Sensor class as the Data object, it works fine with direct field members when i want to display data or sort on it. but i Cant make it work with dot notation.
Class:
public int Id { get; set; } public string? DeviceId { get; set; } public string? Name { get; set; } public string? DisplayName { get; set; } public string? Placement { get; set; } public string? ExtraInformation { get; set; } public DateTime Created { get; set; } public DateTime Changed { get; set; } [ConcurrencyCheck] public DateTime LastChangedByUser { get; set; } public DateTime LastSeen { get; set; } public bool HasMeasurementWarning { get; set; } public SensorType Type { get; set; } public List<SensorWarningRecipient> SensorWarningRecipients { get; set; } = []; public ICollection<LogEvent> LogEvents { get; set; } = []; public bool HasTechnicalWarning { get; set; } public List<SensorDataSeries> DataSeries { get; set; } = []; public List<WarningTrigger> WarningTriggers { get; set; } = []; /// <summary> /// A list of <see cref="SensorWarning"/>s that belong to this sensor, if populated. /// </summary> public List<SensorWarning> Warnings { get; set; } = []; public SensorHardware? SensorHardware { get; set; } public int? SensorHardwareId { get; set; } public SensorStatus? SensorStatus { get; set; } public DateTime? IsMutedUntil { get; set; } public ICollection<SensorGroupSensor> SensorGroupSensors { get; set; } = new List<SensorGroupSensor>();simplyfied Code sample:
<RadzenDataGrid @ref="_grid" Data="@_sensors" TItem="Sensor" AllowSorting="true" SelectionMode="DataGridSelectionMode.Single" AllowPaging="true" AllowFiltering="true" AllowColumnResize="true" ExpandMode="DataGridExpandMode.Single" RowClick="@(args => RowClick(args))"><Template Context="sensor"><SensorDetails Sensor="@sensor" /></Template><Columns><RadzenDataGridColumn TItem="Sensor" Property="DisplayName" Title="Navn" Sortable="true" /></Columns></RadzenDataGrid>How can i acheiv to sort and use data within the sensorgroup ? fex sensorgroup.groupName