Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing headers
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00163637
Message ID:
00163730
Views:
24
>Hi Michelle,
>
>There are a lot of benefits to using your own grid header subclass and the methods for doing so have already been discussed here. I just want to point out that this might also be an excellent place to use a builder. IOW, you could add a method in your base grid class that sorts based on the header object passed to it. Once you've done this, you can write a builder that uses WriteMethod to stick the one line of code to call the custom method into the click (or double click) method of each of your grid headers. Sometimes this is a better approach because then you can still use the Class Designer/Form Designer to work on your grid.
>
>Assuming the grid was the selected object and the method in the grid was called SortGrid, the builder's code would look something like this.
>
>
>=ASELOBJ(laObj)
>FOR lnI = 1 TO laObj.ColumnCount
>   laObjs.Columns(lnI).Controls(1).WriteMethod("Click","This.Parent.Parent.SortGrid(This)")
>NEXT
I don't use the builders and I wouldn't have the foggiest idea how to create one, but I'll keep this in mind in case I ever do.

Thanks,

-Michelle
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform