Until now i handled the sorting of a stringgrid myself. I just saw that there is a columnClicksorts. When this is true columns with only stringa sort fine. Columns with numbers sort wrong.
When i look into the wiki i find CompareCells with an example:
Adjusted a little:
// Result will be either <0, =0, or >0 for normal order.
result := StrToIntDef(StringGrid_ctrl_tabel.Cells[ACol,ARow],0)-StrToIntDef(StringGrid_ctrl_tabel.Cells[BCol,BRow],0);
// For inverse order, just negate the result (eg. based on grid's SortOrder).
if StringGrid_ctrl_tabel.SortOrder = soDescending then
result := -result;
Now only the columns with numbers sort fine. The columns with strings don't sort anymore.
How to sort strings en numbers ?