thanks for your suggestions, I have modified the procedure and works

, sucessfully.
I'll modify a little the code of this procedure:
function TCustomStringGrid.DoCompareCells(Acol, ARow, Bcol, BRow: Integer
): Integer;
begin
if Assigned(OnCompareCells) then
Result:=inherited DoCompareCells(Acol, ARow, Bcol, BRow)
else begin
try
if StrToInt(Cells[ACol,ARow]) < StrToInt(Cells[BCol,BRow]) then
result := -1
else if StrToInt(Cells[ACol,ARow]) > StrToInt(Cells[BCol,BRow]) then
result := 1
else result := 0;
Except
Result:=AnsiCompareText(Cells[ACol,ARow], Cells[BCol,BRow]);
end;
if SortOrder=soDescending then
result:=-result;
end;
end;
I don't know if is the better way but works for me, any suggestios will be welcome; and thanks again.
