Page 1 of 1

How to change dataSource of existing form using a method?

PostPosted: Tue Apr 08, 2014 4:25 pm
by Westy
How can I change an existing form's dataSource property using a method?

Dean
Servoy Developer 6.0.8 - build 1237

Re: How to change dataSource of existing form using a method

PostPosted: Tue Apr 08, 2014 11:28 pm
by ROCLASI
Hi Dean,

The datasource is not a runtime property so you can't change it on the fly. You can however change it using the SolutionModel.
This however requires the 'destruction' of the loaded form before you can change it. So the form can not be visible or in use by anything when you do this.
By the way, what is your exact use-case for this? Perhaps a 'cloned' form with a new datasource might be a better approach. This can all be done by code.

Re: How to change dataSource of existing form using a method

PostPosted: Thu Apr 10, 2014 9:06 pm
by Westy
I like your idea of using a 'clone' of the form. Thank you.

Dean