Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Someone Has Got to Be Doing This (grid questions)
Message
 
 
To
26/03/2003 13:20:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00770335
Message ID:
00770419
Views:
30
>>I would like to a grid display some product codes for a particular company. That part is easy. I currently have an Add button that takes the user to an add screen where they can add a new product one at a time. Well that is not floating well with them. What they would like to do is be able to click on the add button then add the products (how ever many they have to add), add them into the grid then click the save button. In other words they want to bypass the add form and add and have the ability to add more than one product at a time (instead of clicking add button then adding one product then clicking save then doing it all over again).
>>
>>Can someone lead me into the right direction? Also, when the user clicks add I will un-readonly the grid, but how can I keep the products that already exist for that company readonly?

>
>If your table is buffered the records added should have a negitive recno. Then you can create two sets of controls for the grid. Lets say txt_enabled and txt_disabled. Then in the columns DynamicCurrentControl property you could add IIF(RECNO() < 0, 'txt_enabled', 'txt_disabled'). This should make the records allready added disabled or readyonly depending on how you set up the controls. As far as adding records you just have to set the AllowAddNew to true. The more daunting task is validating the data in the grid in the grid and on the save.

Chuck,

I believe, you don't have to use DynamicCurrentControl for that. You can use AfterRowColChange method and put something like this.readonly = recno()>0

However, once you saved, you would not be able to modify even these new added items. If you want to be able to modify them, you should know the last recno() in the table before starting to work (just go to eof in unordered table with set deleted=off and save it in form's property).

That's the idea...
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform