yo uso algo como esto al hacer click en la barra de titulos
Código Delphi
[-]
procedure TfrmCatalogoAnexo.dbgAnexoTitleClick(Column: TColumn);
$J+}
const PreviousColumnIndex : integer = -1;
{$J-}
begin
if dbgAnexo.DataSource.DataSet is TCustomADODataSet then
with TCustomADODataSet(dbgAnexo.DataSource.DataSet) do
begin
if PreviousColumnIndex > -1 then
begin
dbgAnexo.Columns[PreviousColumnIndex].title.Font.Style :=
dbgAnexo.Columns[PreviousColumnIndex].title.Font.Style - [fsBold];
end;
try
except
end;
Column.title.Font.Style := Column.title.Font.Style + [fsBold];
PreviousColumnIndex := Column.Index;
if (Pos(Column.Field.FieldName, Sort) = 1) and
(Pos(' DESC', Sort)= 0) then
Sort := Column.Field.FieldName + ' DESC'
else
Sort := Column.Field.FieldName + ' ASC';
end;