General information
Category:
Coding, syntax & commands
>>>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only