Mega Code Archive

 
Categories / Delphi / VCL
 

Allow column resize in a tdbgrid but prevent move

Problem: How to allow column resize in a TDBGrid but prevent move ? Unlike the TStringGrid, the TDBGrid has no goColMoving Property published. So here's a workaround for it: TStringGrid(DBGrid1).Options:= TStringGrid(DBGrid1).Options-[goColMoving]; {***} Problem: Das TDBGrid hat keine Eigenschaft goColMoving - wie das TStringGrid - um zu verhindern, dass Spalten verschoben werden könnnen. (Wobei Spalten vergrössern erlaubt sein soll) So geht es trotzdem: TStringGrid(DBGrid1).Options:= TStringGrid(DBGrid1).Options-[goColMoving];