Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmaticaly addrow to grid and deleterow from grid
Message
From
25/10/2002 08:21:40
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00714250
Message ID:
00715351
Views:
26
>Hi Ed,
>how can i do this programmaticaly for each column ?

Create a class such as Nancy's AddNewTextBox class from here example, and then step through the Columns one at a time. Remove the default textbox from the column using RemoveObject, and then add a new instance of the AddNewTextBox class to the column, naming it 'text1'. Once the object has been added, assign the name of the new textbox, 'text1' to the column's ActiveControl property. Do this for each column (you can use a FOR EACH loop of a FOR NEXT loop as you see fit, and as fits your programming style. If you don't want to add textboxes, you can create subclasses of other types of controls with similar keypress actions, and drop in those subclasses instead. this must be done programmatically for each column; there is no way in the existing product to tell it to automatically use a different class from the native base textbox class when the grid self-creates.

Work through Nancy's code carefully, trying to see what you would need to do to add an additional column to her suggestion. Cetin's FoxyClasses has the functionality to do what you want more easily, but it is a commercial product and you'd need to buy it. Another option would be to hire a consultant to do the work for you; I don't know what rates for consultants are like where you are, but typically, VFP consultants in the US are paid anywhere from $30/hr for complete beginners, to, in some cases, in excess of $200/hr for world-class experts.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform