Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding command button to grid...
Message
 
To
16/12/1998 20:19:29
Larry Long
ProgRes (Programming Resources)
Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00168153
Message ID:
00168422
Views:
21
>>>I have added a command button to a column in my grid. How do I get it to show in the grid so the user can press it and call a function?
>>
>>Check the SPARSE property of the column if you want it to show for all lines. If it just isn't being displayed and the default grid textbox control is shown, you need to change the CURRENTCONTROL of the column to the name of the command button you added.
>I want to show the text and the command button (or similar control) beside it to allow for a drill down. Do I need to be using another kind of object for this?

Couldn't you just have two columns in the grid, one beside the other? If not, what you may want to try is create a container class and place a textbox and command button in it, align as needed. Then you can add this container to the grid column. Be sure to update the controlsource for the textbox used to display whatever value is needed.

One drawback to this approach is that a container in a column looses the ability to scroll the grid with the arrow keys. You have to go through hoops to control this. It requires code in the containers textbox to check for arrow keys, issue a respective skip +/- and/or Grid.DoScroll() method. Then you have to issue a direct setfocus to the same object name so the new record would receive the focus on whatever the new row would be.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform