Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Classes not to subclass
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00792211
Message ID:
00793232
Views:
41
Regarding the prg-based member classes (thanks again), I pointed the grid's MemberClass and HeaderClass properties to them as you suggest, but when I increase the grid's ColumnCount my custom classes aren't used.

Also, if I decrease the ColumnCount to 0 and then bump it back up to 1, the previous custom column is replaced with the standard VFP base class column.

Is there something else that needs to be done, or is this a bug?



>Hi Agnes.
>
>Does it replace the standard textbox or add it a new Object?
>
>That depends on how you build the grid < s >. If you define your grid as having a ColumnCount of either -1 or some number greater than 0, VFP automatically creates base class columns with base class text boxes and headers. You then have to remove these base class columns before you re-add your custom columns.
>
>When you add your custom columns, they are created with the custom headers and text boxes that you define in their class definition using ADD OBJECT. If you do not specify a custom header or textbox class using ADD OBJECT, then they are instantiated using base classes. Is that a little more clear?
>
>BTW Is there a reason that you EVALUATE the columns and not use THIS.COLUMNS(lnCol).***?
>
>Because we are removing columns inside that loop and the column referenced using the columns collection and the index will be incorrect. All you need to do to convince yourself of that fact is to add this code:
>
>
>MESSAGEBOX( This.Columns[ lnCol ].name )
>
>
>inside the loop and see what happens < s >. You will see a messageBox for Column1, Column3 and Column5 (if your grid is defined with 5 columns) before you get an error.

Read about the greatest fraud in the history of mankind.
See TaxableIncome.net.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform