Hello everyone, while trying to implement a grid with filtering and sorting, I came across an issue that seems to be recurring. In the database, I have columns (IdLotto and IdPratica) that are numeric.
From what I’ve read, filtering and sorting of numbers are not supported, only strings are. So I tried searching and implemented my own partial solution:
var avrs = _avrService.GetFiltered().Select(a =>
new GetAllAvr()
{
IdLotto = a.IdLotto.ToString(),
IdPratica = a.IdPratica.ToString()
});
var dsResult = avrs.ToDataSourceResult(request);
GetFiltered returns IQueryable of db's entity.
Partial because filtering works, but sorting doesn’t. Since string sorting is different from numeric sorting, the result is actually an incorrect order.
I wonder if I'm doing something wrong, if I need extra support from jQuery, or if I need to fully customize filtering and sorting in the controller method.
Thanks for the help