Board index » delphi » DBGrid: Change column order stuffs .Fields!

DBGrid: Change column order stuffs .Fields!

If I refer to the fields in my TDBGrid via the .Fields property:
DBGrid.Fields[0].AsString

and the user changes the order of the columns at runtime...

then the underlying .Fields change position too!! Even more astonishingly
the DBGrid.Datasource.Dataset.Fields change too!!

Is this a bug?  Does anybody think this is desirable behaviour?

------------------------------------,------------------------------------------
Kerry Sainsbury, ke...@kcbbs.gen.nz |      THE INFORMIX FAQ v2.4 Oct 95
Quanta Systems, Auckland            | http://www.iiug.org/techinfo/faq/
New Zealand. Work: +64 9 377-4473   |  ftp://ftp.iiug.org/pub/informix/faq
             Home: +64 9 279-3571   |  ftp://kcbbs.gen.nz:/ftp/pub/informix/

 

Re:DBGrid: Change column order stuffs .Fields!


There is an option in the dbgrid named Options | dgColumnResize. Set it
to false and users can't change column order at runtime anymore.
Peter.

Other Threads