Understanding Column Visibility in the SmartDataBrowser and SmartUpdatableBrowser

There are two states of columns not visible in the UltraGrid derived SmartComponent Library Controls SmartDataBrowser and SmartUpdatableBrowser controls.

  • Currently not visible – on users choice. That’s Hidden = TRUE. Users could still add columns back in by dragging them in from the column chooser (main menu).
  • Never visible – by progammers choice. That’s ExcludeFromColumnChooser = TRUE. Users won’t see those columns in the column chooser. And thus could not make the column visible.

As a developer you should consider the columns that you during developement set the Hidden attribute to TRUE are just an initial setup of the Grid for all users. And columns that you assign the ExcludeFromColumnChooser attribute to TRUE are more regulative and always hidden. For instance users should never see the GUID columns. So those require the ExcludeFromColumnChooser attribute set to TRUE.

So you need do set attributes in the Form (Grid instance) that way:

  • Never visible: ExcludeFromColumnChooser = TRUE and Hidden = TRUE
  • By default hidden, but user may make them visible: ExcludeFromColumnChooser = FALSE and Hidden = TRUE

There is an irritating side-effect for developers:

When you make a Column “Hidden” (but not ExcludeFromColumnChooser) and then rerun the screen, the system may have remembered that last time it was visible and should be shown again.

You can reset your preferences for that grid by removing records in the Windows repository:

Each grid has a “SettingsKey” property. That’s a GUID value. That value refers to a node in the Windows Registry:

HKEY_CURRENT_USER\SOFTWARE\{Application Vendor}\{Application Name}\{That Settings Key}.

The actual registry key is determined by the following Framework Settings setting during the application startup.

Consultingwerk.Framework.FrameworkSettings:BaseRegistryKey = "Software~\Consultingwerk Ltd.~\Customer Explorer~\":U .

As a developer, it’s considered save, to delete the resulting node from the Windows registry to return to the initial view of the Grid.

Locating Registry Key for Grid Settings

The storing of the grid column settings to the Windows registry is turned on by the following code block in the application startup procedure.

&IF DEFINED (NoStaticsInHybrids) EQ 0 &THEN
Consultingwerk.SmartComponents.Implementation.SmartDataBrowser:SaveColumnSettings = TRUE .
Consultingwerk.SmartComponents.Implementation.SmartDataBrowserSettings:SaveColumnSettings = TRUE .