Page 1 of 1

Show/Hide column in DBTreeView (dynamically)

PostPosted: Mon May 30, 2016 3:41 pm
by huber
Hi All

Is there a way to show/hide a column of a DBTreeView? I have a binding of an icon column to the DBTreeView and would like to allow the user to hide/show it from within the application. The code in simplified form looks like:

Code: Select all
var binding = elements.dbTreeView.createBinding(databaseManager.getDataSourceServerName(controller.getDataSource()), databaseManager.getDataSourceTableName(controller.getDataSource()));
...
binding.setImageMediaDataprovider('icon');
...


Regards, Robert

Re: Show/Hide column in DBTreeView (dynamically)

PostPosted: Wed Jun 01, 2016 9:14 am
by Harjo
Change the underlying foundset. because the DBtreeview is based on foundset's, so if you want hide a column, you have to hide/remove the column from the foundset!

Re: Show/Hide column in DBTreeView (dynamically)

PostPosted: Wed Jun 01, 2016 10:03 am
by huber
Thanks Harjo for your solution. It's exactly what I did. But I thought, there must be a way more elegant solution to it. Like dynamically adding removing the binding of the field. But it doesn't seem so.

Harjo wrote:Change the underlying foundset. because the DBtreeview is based on foundset's, so if you want hide a column, you have to hide/remove the column from the foundset!