The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum. |
What's the best way to delete a grid row. |
Post Reply |
Author | |
jgold
Moderator Group Moderator Joined: December 29 2003 Location: United States Status: Offline Points: 48 |
Post Options
Thanks(0)
Posted: March 06 2019 at 3:28pm |
I actually have two questions. The first is the interface. Is there a standard way to give the users the ability to delete a grid row? There are a few options;
1. Add a button to each row of the grid to delete that row. 2. Add a button above or below the grid to delete the current row. 3. Add a context button to give the option to delete a row when you right click on it. The one I thought I would go with is the context button but I couldn't find any examples on how to do the pop up context menu. That's my second question. Does anyone have an example of a pop-up context menu? |
|
Shrek59
Senior Member Joined: December 04 2006 Location: New Zealand Status: Offline Points: 208 |
Post Options
Thanks(0)
|
Typically, I create 'Delete row' actions in a standard menu, as a toolbar button, and in a context menu. All of these actions get given the same identifier so I can then redirect the event handlers for the toolbar and the context menu to the main menu event handler. Using a context menu: First of all, create the popup menu. This is just another control on the form - but it isn't visible. You will see it in the list of controls in the tree. It is defined just like an ordinary menu. On the grid, activate the GECONTEXT event, and update the program so that the event handler is created. In the event handler, get the row number where the click occurred (guiargs<1, 2>). Watch out for values of -1 which means the user has clicked somewhere where there is no row! If you have a selected row highlighted (like I do), then you should move that highlight now. Next, run the ATGUISHOW subroutine to display the context menu. Now you need to respond to any events that occur when the user clicks one of the options within the popup menu. There should be another event handler in your program to handle that. I hope all that makes sense to you. Using context menus isn't totally intuitive, but it is quite logical when you think about it. i.e. you respond to the right-click by SHOWing the menu; then you respond to the user selection on the context menu. Cheers, Brian
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |