Dropdown filter and grid

I have a date field in most of my grids that renders the latter of update or created:

<RadzenDataGridColumn TItem="EsWlite.Models.Ecosys.TblClientProperty" FormatString="{0:d}" Title="Date">
  <Template Context="data">
  @(data.Updated>data.Created?data.Updated:data.Created)
  </Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="EsWlite.Models.Ecosys.TblClientProperty" Width="45px">
</RadzenDataGridColumn>

The filter doesn't work with a value selecte this way.

What is the easiest way to filter on the displayed value? I'd rather not create a custom method for every page that has a grid on it.

Thanks

John

I think u should add a property to ur class (EsWlite.Models.Ecosys.TblClientProperty) where in the get u read the date based on ur condition?

Something like this

public string NewerDate
{ 
          get
          {
                 return Updated > Created ? Updated : Created
          }
}

And then change ur current column to use the new property

1 Like

Thanks, that makes sense