On 2014-06-05 12:12, Richard Kaye wrote:
You can certainly put the grid definition in the grid init, especially
if it does not change after it comes up. The particular scenario that
took me to use form level methods to handle this involved changing the
number of columns (and data) shown based on the user selecting a
different option in the UI after the initial grid instantiation. Think
of a form with a grid and radio buttons to change the grid view. Being
a bit on the pedantic side, I don't like calling the INIT of a control
after it's been...INITed. :-)
I came up with the auto-setting of columns in the grid.init event (and
yes, the Init event is only called once at time of Init!) after you'd
change the RecordSource and all your columns would lose their
controlsource. I said "never again will I retype this crap!" and I
didn't. I just tell the grid what RecordSource it should be using and
it seeds the ControlSource per column at Init time via something like
this:
(in grid.init)
for each oColumn in this.Columns
oColumn.ControlSource = this.RecordSource + "." + oColumn.Name
endfor
Something like that. That way, like the Ronco Rotisserie, I can "set it
and forget it!" :-)
--Mike
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.