Hi Support,
I'm taking over a project from another developer. So I'm a newbie to the Radzen component, so be nice to me.
In this project there is a nested grid that has sorting and filtering options, but this only works if the column is not a template. The header to the template column has no filter or sorting only title is showing.
So my problem is how to make sure that all columns have options for filtering and sorting. This applies especially to columns with Template. Have I missed something?
This is the property that holds the data
public IEnumerable<Versioned<FrameAgreement>> VersionedSearchResult { get; set; }
Here are the dtos
public class Versioned<T>
{
public Versioned(T currentVersion, IEnumerable<T> oldVersions)
{
CurrentVersion = currentVersion;
OldVersions = oldVersions;
}
public T CurrentVersion { get; }
public IEnumerable<T> OldVersions { get; }
}
Here are the object
public class FrameAgreement : IIncentive
{
public FrameAgreement(Guid id, string approverLoginName, string attachmentUrl, DateTime? archiveDate, Guid? cesarConditionTypeId, int classificationCode, string comments, string companyName, string frameAgreementCode, bool isManual, string primaryOrganisationNumber, string relevantDateType, string status, string type, DateTime? validFrom, DateTime? validTo, int? version, string validationType, byte[] timeStampDw, string information)
{
Id = id;
ApproverLoginName = approverLoginName;
AttachmentUrl = attachmentUrl;
ArchiveDate = archiveDate;
CesarConditionTypeId = cesarConditionTypeId;
ClassificationCode = classificationCode;
Comments = comments;
CompanyName = companyName;
FrameAgreementCode = frameAgreementCode;
IsManual = isManual;
PrimaryOrganisationNumber = primaryOrganisationNumber;
RelevantDateType = relevantDateType;
Status = status.ToEnumOrDefault<IncentiveStatus>();
Type = type;
ValidFrom = validFrom;
ValidTo = validTo;
Version = version ?? 1;
ValidationType = validationType;
TimeStampDw = timeStampDw;
Information = information;
}
public Guid Id { get; }
public string ApproverLoginName { get; }
public string AttachmentUrl { get; }
public DateTime? ArchiveDate { get; }
public Guid? CesarConditionTypeId { get; }
public int ClassificationCode { get; }
public string Comments { get; }
public string CompanyName { get; }
public string FrameAgreementCode { get; }
public bool IsManual { get; }
public string PrimaryOrganisationNumber { get; }
public string RelevantDateType { get; }
public IncentiveStatus Status { get; }
public string Type { get; }
public DateTime? ValidFrom { get; }
public DateTime? ValidTo { get; }
public int Version { get; }
public string ValidationType { get; }
public byte[] TimeStampDw { get; }
public string Information { get; }
}
<RadzenGrid ColumnWidth="200px" Count="@VersionedSearchResult.Count()" Data="@VersionedSearchResult" AllowColumnResize="true"
AllowSorting="true" AllowFiltering="true" AllowPaging="true" PageSize="@pageSize"
TItem="VSSI.API.Shared.Dtos.Versioned<VSSI.API.Shared.Dtos.FrameAgreement>">
<Template Context="versionedFrameAgreement">
<RadzenGrid Data="@versionedFrameAgreement.OldVersions" TItem="VSSI.API.Shared.Dtos.FrameAgreement" AllowSorting="true" AllowFiltering="true">
<Columns>
<RadzenGridColumn Property="FrameAgreementCode" TItem="VSSI.API.Shared.Dtos.FrameAgreement" Title="@(localizer["FrameNumberColumn"])">
<Template Context="data">
<div style="cursor:pointer;font-weight:bold;" @onclick="@(()=>FrameAgreementNameClicked(@data.Id.ToString()))">@data.FrameAgreementCode</div>
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.FrameAgreement" Title="@(localizer["CompanyNameColumn"])" Property="CompanyName" />
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.FrameAgreement" Title="@(localizer["PrimaryOrganisationNumberColumn"])" Property="PrimaryOrganisationNumber" />
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.FrameAgreement" Width="100px" Title="@(localizer["TypeColumn"])" Property="Type" />
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.FrameAgreement" Width="100px" Title="@(localizer["StatusColumn"])" Property="Status" />
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.FrameAgreement" Width="100px" Title="@(localizer["VersionColumn"])" Property="Version" />
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.FrameAgreement" Title="@(localizer["ValidFromColumn"])" Width="100px">
<Template Context="data">
@(data.ValidFrom.HasValue ? data.ValidFrom.Value.ToShortDateString() : "N/A")
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.FrameAgreement" Title="@(localizer["ValidToColumn"])" Width="100px">
<Template Context="data">
@(data.ValidTo.HasValue ? data.ValidTo.Value.ToShortDateString() : "N/A")
</Template>
</RadzenGridColumn>
</Columns>
</RadzenGrid>
</Template>
<Columns>
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.Versioned<VSSI.API.Shared.Dtos.FrameAgreement>" Title="@(localizer["FrameNumberColumn"])">
<Template Context="data" >
<div style="cursor:pointer;font-weight:bold;" @onclick="@(()=>FrameAgreementNameClicked(@data.CurrentVersion.Id.ToString()))">@data.CurrentVersion.FrameAgreementCode</div>
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.Versioned<VSSI.API.Shared.Dtos.FrameAgreement>" Title="@(localizer["CompanyNameColumn"])" Property="CurrentVersion.CompanyName" />
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.Versioned<VSSI.API.Shared.Dtos.FrameAgreement>" Title="@(localizer["PrimaryOrganisationNumberColumn"])" Property="CurrentVersion.PrimaryOrganisationNumber" />
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.Versioned<VSSI.API.Shared.Dtos.FrameAgreement>" Width="100px" Title="@(localizer["TypeColumn"])" Property="CurrentVersion.Type" />
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.Versioned<VSSI.API.Shared.Dtos.FrameAgreement>" Width="100px" Title="@(localizer["StatusColumn"])" Property="CurrentVersion.Status" />
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.Versioned<VSSI.API.Shared.Dtos.FrameAgreement>" Width="100px" Title="@(localizer["VersionColumn"])" Property="CurrentVersion.Version" />
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.Versioned<VSSI.API.Shared.Dtos.FrameAgreement>" Title="@(localizer["ValidFromColumn"])" Width="100px">
<Template Context="data">
@(data.CurrentVersion.ValidFrom.HasValue ? data.CurrentVersion.ValidFrom.Value.ToShortDateString() : "N/A")
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="VSSI.API.Shared.Dtos.Versioned<VSSI.API.Shared.Dtos.FrameAgreement>" Title="@(localizer["ValidToColumn"])" Width="100px">
<Template Context="data">
@(data.CurrentVersion.ValidTo.HasValue ? data.CurrentVersion.ValidTo.Value.ToShortDateString() : "N/A")
</Template>
</RadzenGridColumn>
</Columns>
</RadzenGrid>