Si por jerárquico te refieres a que al hacer click en el título se ordenen los registros en orden alfabético o de mayor a menor y viceversa, puedes utilizar este código (Es para Access pero creo que se debe poder modificar para otras bases de datos):
Código Delphi
[-]procedure Form1.DBGrid1TitleClick(Column: TbsColumn);
begin
if DBGrid1.DataSource.DataSet is TCustomADODataSet then
with TCustomADODataSet(DBGrid1.DataSource.DataSet) do
if (Pos(Column.FieldName, Sort) = 1) and (Pos(' ASC', Sort)= 0) then
begin
Sort := Column.FieldName + ' ASC';
end
else
begin
Sort := Column.FieldName + ' DESC';
end;
Indice := Column.Index;
end;
Salu2 y ojalá haya podido ayudarte