--- El jue 12-may-11, Alexander Klenin <kle...@gmail.com> escribió:

> De: Alexander Klenin <kle...@gmail.com>
> Asunto: Re: [Lazarus] Sorting StringGrid by column click
> A: "Lazarus mailing list" <lazarus@lists.lazarus.freepascal.org>
> Fecha: jueves, 12 de mayo de 2011, 7:45
> On Thu, May 12, 2011 at 23:37,
> Hans-Peter Diettrich
> <drdiettri...@aol.com>
> wrote:
> > Alexander Klenin schrieb:
> >
> >> BTW, I agree with the commenter in Mantis who said
> that sorting type
> >> is a required
> >> requisite. Sorting numeric columns as strings is
> not merely useless, but
> >> subtly
> >> dangerous, since it may deceive user with
> incorrect results.
> >
> > A CustomSort method would be the way to go.
> >
> 
> That is true (although, of course, it should be an event,
> not method),
> but at least numeric sort should IMHO be supported by
> default,
> since otherwise there is a high probability of user
> confusion.
> 
> -- 
> Alexander S. Klenin

Just let's not forget that this is a generic *string* grid, why users should 
expect it to sort numbers when the grid is specifically made to hold strings?

Appart from strings, the grid already supports Custom Sorting, so it can sort 
any way the user wants, even numbers. Just write an handler for OnCompareCells, 
this is even documented: 
http://wiki.lazarus.freepascal.org/Grids_Reference_Page#Sorting_Columns_or_Rows

Jesus Reyes A.

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to