I am trying to filter on a multiselect listbox using a filter template that is a drop down. The filter has the correct entries but it is not being applied to the listbox. I have the listbox working it the view and edit scenarios fine it's just the filter at this point that I cannot get working.
Here is the code for the datacolumn:
<RadzenGridColumn Width="200px" TItem="MGSong" Property="SongCatalogs" Title="Catalog(s)">
<FilterTemplate Context="song">
<RadzenDropDown TextProperty="Name" ValueProperty="ID" Style="width:100%"
Data="@catalogs" TValue="int" />
</FilterTemplate>
<Template Context="song">
<RadzenListBox style="height:100px" TValue="int"
Data="song.SongCatalogs.Select(x => x.Catalog).ToList()" TextProperty="Name" ValueProperty="ID"
ReadOnly="true" />
</Template>
<EditTemplate Context="song">
<RadzenListBox style="height:200px" @bind-Value="@workingCatalogIDs"
Data="@catalogs" TextProperty="Name" ValueProperty="ID" Multiple="true"
TValue="IEnumerable<int>" />
</EditTemplate>
</RadzenGridColumn>
Here is my class definitions:
public class MGSong
{
private List _catalogIDs = new List();
public int ID { get; set; }
public string External_ID { get; set; }
public string Title { get; set; }
public int Runtime { get; set; }
public string Intro1 { get; set; }
public string Intro2 { get; set; }
public string Intro3 { get; set; }
public string Ending { get; set; }
public bool Active { get; set; }
public DateTime ModifiedDateTime { get; set; }
public int ModifiedBy { get; set; }
public List<SongArtist> SongArtists {get; set;}
public List<SongCatalog> SongCatalogs { get; set; }
public IEnumerable<string> CatalogNames
{
get
{
return SongCatalogs.Select(x => x.Catalog.Name).ToArray();
}
}
public object Clone()
{
return MemberwiseClone();
}
}
}
public class SongCatalog
{
[Key]
public int ID { get; set; }
public int MGSongID { get; set; }
public int CatalogID { get; set; }
public DateTime ModifiedDateTime { get; set; }
public int ModifiedBy { get; set; }
public MGSong MGSong { get; set; }
public Catalog Catalog { get; set; }
}
public class Catalog
{
[Key]
public int ID { get; set; }
public string Name { get; set; }
public string StartingRange { get; set; }
public string EndingRange { get; set; }
public DateTime ModifiedDateTime { get; set; }
public int ModifiedBy { get; set; }
public object Clone()
{
return MemberwiseClone();
}
}
I am new to using the Radzen components, Blazor and generics so it's quite possible I'm doing something totally wrong. Any help you can give would be appreciated.