Let's say, I have a set of TField
objects and want to change their visibility in some DBGrid dynamically. I also want to allow users to change column order in this DBGrid, and have some fixed columns.
I know proper way to hide/show columns on DBGrid, but there is a big, big design flaw in VCL: having Column object, one can travel to it's Field object, but cannot find way back.
All I want is just kind of Column property inside Field object, so I can type something like this:
Field.Column.Visible := False;
and hide any column inside DBGrid with assigned Columns property.
I know I can just create HashSet or Collection with Columns and quickly find corresponding columns, but is there exist more straight way to do this?