Перемещение колонок в TDBGrid
Оформил: DeeCo
Автор: http://www.swissdelphicenter.ch
type
THackAccess = class(TCustomGrid);
{
THackAccess Is needed because TCustomGrid.MoveColumn is
protected and you can't access it directly.
THackAccess Braucht man, da TCustomGrid.MoveColumn in der
Protected-Sektion steht und nicht direkt darauf zugegriffen werden kann.
}
// In the implementation-Section:
procedure MoveDBGridColumns(DBGrid: TDBGrid; FromColumn, ToColumn: Integer);
begin
THackAccess(DBGrid).MoveColumn(FromColumn, ToColumn);
end;
{Example/ Beispiel}
procedure TForm1.Button1Click(Sender: TObject);
begin
MoveDBGridColumns(DBGrid1, 1, 2)
end;
|