Dear TMS

I am trying to read in the saved column states but it does not seem to include the "Tag"-property?


I use this to indicate the visible state of the column.
It loads correctly so that the hidden columns stays hidden, so if there is any way to query if the column is hidden or not that would be great also.
I've tried DBAdvGrid->Columns->Items->Field->Visible but this property does not save also.

Can anyone offer me any help with this?

Are you referring to the use of the function 
StringToColumnStates ?

If so, this indeed does not save the column's Tag property. It is limited to saving the column order and whether a column was hidden or not with the function Grid.HideColumn()
More details, a sample that is explained can be found at:

Hi Bruno

Yes it is the StringToColumnStates this post is referring to.

That it doesn't save the tag is also ok. As I wrote before, I am basically looking for a way to tell if a column is hidden or not. I see that there are methods for hiding columns, and even for finding the number of hidden columns, but how to query a column to check if it is hidden?

Hi !
I originally asked to add that StringToColumnStates function, but I agree with Niklas that handlind with hidden columns is not very easy, there is however function IsHiddenColumn(ColIndex).

Could be it possible to add column property visible=true/false in the future versions ?
That would make handling of hidden columns much easier also at desing time.

Dear Wahrn

You are the hero of the day.
That was exactly what I was looking for. I don't know how I had overlooked that method, I had been looking all day for something like that.
Eventually I ended up making a routine that after StringToColumnStates is loaded hides every column one by one and after each column checks if the property NumHiddenColumns has changed, as a method of identifying each hidden column.

But indeed IsHiddenColumn(ColIndex) is very much easier and more clean.
I no longer have any need for tags then (or to change the underlying fields visible property).

Again thank you Wahrn Heikki