From the code in the question, the most obvious mistake is that the variable grd_idx
is not initialised. You must initialise variables before using them.
On top of that it is possible that you are passing an invalid object reference in the first parameter. We cannot tell from here. However, it is possible that you are passing a global variable that has not been initialised. It looks awfully like you should be passing Self
rather than that global variable.
GridSettings(Self, 'cost', 'save');
Of course, I am assuming here that Self
is what you intend to pass here. Since you did not supply very much code, we can only guess as to the details of your code.
You ask how to make the OnCreate
event fire after all controls are created. Well, that is already the case. The OnCreate
method is fired after the controls are created and their properties streamed in.
I would also comment that using strings to select discrete options is not a good idea. Use enumerated types for that.