[email protected] wrote on 2016-02-03: 
>  On 2016-02-03 14:51, Kurt Wendt wrote:
>  Mike - thanks for all your input.
>  
>  FYI - VFPSP2 v 9.00.0000.5815
>  
>  https://www.berezniker.com/content/pages/visual-foxpro/vfp-90-versions
>  
>> 
>> I've been testing of code on this test Form - and on there I have a
>> Regular Grid and the subclassed Grid. So, I've been testing code on
>> the regular grid - and have the current functionality to sort the data
>> by hitting column header. Its just getting that similar code applied
>> to that subclassed Grid that seems to be the issue. Of course, yeah,
>> things will have to be implemented a bit differently.
>> 
>> That method, Data_resort, actually is the custom Method of the
>> subclassed Grid - which will handle the sorting.
>> 
>  How about putting "thisform.Data_Resort()" in the Whatever.Click event?
>  
>> 
>> Am trying out the BindEvent now, but, may resort to using your code
>> below. Will report back on my progress...
>> 
>  I'm sure BindEvent is great as many greats here suggest it, but I never
>  got into it.
>  

Regarding BindEvents()

Ted Roche stated several times "Events should always call methods." 
Until I started tracking down odd bugs with Timers and getting the "Is not
an object" error with code in BindEvents I didn't fully understand why he
said that.
There are times an event will fire and the workspace the code thinks it
should be in according to what you wrote isn't really there. 

I like BindEvents(), however, I use the with a great deal of caution these
days.

If at all possible subclass.

On could go to extremes by, subclass the Column and set the MemberClass and
MemberClassLibrary on a grid for all the columns added to it to inherit from
it.
The Column class has HeaderClass and HeaderClassLibrary to do the same.

You may need this bit of help with the BindEvents, if you choose to go that
route:
    lnEventCount = AEVENTS(arrEvent, 0)
    IF NOT VARTYPE(arrEvent(1)) = "O"
       RETURN
    ENDIF
    loHeader = arrEvent(1)

Tracy Pearson
PowerChurch Software


_______________________________________________
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.

Reply via email to