Hello I'm working on blazor server side application, I've displayed data into GRID. and I've provided filter for columns wherever needed. We can show/hide filter option with Filterable="true/false" value.
My concern is quite different. I'm having tables named Invoice, Client and ClientGroup
Here Client and ClientGroup tables contains Id/value fields, say dropdown data. And Invoice table have reference of ClientId and ClientGroupId having foreign key reference
I'm displaying Invoice table data into Telerik Grid with blazor
Below is my sample code to display ClientGroup data into Grid but filter option is not working because model have int property.
<GridColumn Field="@(nameof(InvoiceModel.ClientGroupId))" Title="ClientGroup" Width="300px" Filterable="true">
<Template>
@{
var data = context as InvoiceModel;
var clientGroup = StaticData.GetClientGroupName(data.AffilatedGroup);
if (data.IsDisplayClientGroupDropdown)
{
<select class="form-control small-input-financial-view drp-finanz w-100"
id="Medienart">
@foreach (var item in ClientList)
{
if (item.ClienGrouptName == clientGroup)
{
<option selected value="@item.ClientGroupId">
@item.ClienGrouptName
</option>
}
else
{
<option value="@item.ClientGroupId">
@item.ClienGrouptName
</option>
}
}
</select>
}
else
{
if (string.IsNullOrEmpty(clientGroup))
{
<a href="javascript:;"
title="No clientGroup data found"
class="maximum-cher-div">
No clientGroup data found
</a>
}
else
{
<a href="javascript:;"
title="@clientGroup"
class="maximum-cher-div">
@clientGroup
</a>
}
}
}
</Template>
</GridColumn>
I did some research for dropdown values filter but I didn't get any appropriate solution. any type of the help would be appreciated.