Hello,
I am trying to use an SfGrid to view results that are coming back from a web service and and deserialized to a generic record structure:
public class Record
{
public string Id { get; set; }
public Dictionary<string, object> Values { get; set; } = new Dictionary<string, object>();
}
I know the schema information about the data coming back, and that info and a custom adaptor, I'm able to view the data just fine:
<SfGrid @ref="@Grid" TValue="Record" AllowPaging="true" ShowColumnChooser="true" AllowReordering="true" AllowSorting="true" AllowResizing="true" AllowFiltering="true" Toolbar="@_toolbarItems">
<GridFilterSettings ShowFilterBarStatus="true" Mode="FilterBarMode.Immediate" Type="FilterType.FilterBar"></GridFilterSettings>
<SfDataManager Adaptor="Adaptors.CustomAdaptor">
<TableAdaptor TableId="@TableId"></TableAdaptor>
</SfDataManager>
<GridColumns>
@foreach (var field in Table.Fields)
{
<GridColumn Type="@field.AsColumnType()" HeaderText="@field.Name" TextAlign="TextAlign.Left" Width="130" AllowFiltering="true">
<Template>
@{
var record = context as Record;
<div>@(record?.Get[field.Id] ?? string.Empty)</div>
}
</Template>
</GridColumn>
}
</GridColumns>
</SfGrid>
The problem I'm encountering is that there is no way for me to filter the results. Through experimentation, it appears the only way for filtering to work is is a GridColumn is bound to a Field. That makes sense, as you'd need to know the Id of the field to filter for; however when you're using a Template to choose the value to display, there appears to be no way to filter. Am I missing something? Is there a way to specify a ColumnId for filtering without having to bind to a Field?
Thanks,
Jon...