Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4028
Prevent new columns automatically being added to UltraGrid
posted

I use the UltraGrid in my C# winforms app by binding it to strongly typed objects, which are generated by a code generater. So each grid is in effect bound to a table in the underlying database.

Every now and again, I will make changes to the database, usually by adding fields to existing tables. This causes a few problems in my UltraGrids. When I re-generate the code (and hence the strongly typed objects), the grids automatically get new columns, and I am forced to change some properties of the new columns in the UltraGrids if I dont want these new columns showing:
"ExcludeFromColumnChooser" from Default to True
"Hidden" from False to True.

This is getting a bit tiresome. It is getting such that I am put off adding new fields, as it is quite a task finding all of the grids I need to manually exclude the fields from.

Is there an easier way to do this? I would prefer if the default behaviour was that new columns were hidden, and excluded from the column chooser.

Thanks.

----- EDIT ----

Just discovered there is a NewColumnLoadStyle property, that does half of what I want - it sets new columns to "Hidden = true". This does not sort out the ExcludeFromCOlumnChooser thing though - this is still the default (which is to show).

It will be a pain to set the default column chooser thing to false, as t hat would mean I would need to hunt down every column that needs to be in the chooser and set it from default to true...