1 (edited by CDB 2020-08-26 10:13:07)

Topic: Updating a tablegrid after deleting an entry via context menu

I have decided to allow an end user to delete an item from a tablegrid  by right clicking and selecting 'delete'. This is purely because my survey of end users were concerned about using a  button to delete the entry and they felt it safer to deliberately highlight an entry and then right click.

I need to place formX.tablegridX.dbUpdate  somewhere.


My problems are:


1. I would like to update this table grid to reflect the new data result - currently it refreshes but without the data filtered.


2. I would like to update a different table grid to reflect the deletion of this item.


I can't fathom how to update either table grid to reflect automatically the new data after using the context menu.


I've tried the following events for the 'delete' table grid:


OnChange - this does nothing in this context.
OnAfterEdit -  ditto
OnMouseUp - ditto


Obviously once I know what event the right click delete option can trigger I can then reload the delete table grid with the filtered data rather than the complete database.


Is there a way perhaps I could have the right click delete menu, trigger a hidden button action which I could use to reload both tablegrids?


Does anyone have a solution?


PS: I should add the right click delete option is via the tablegrid properties in th eobject inspecter and AllowDelete = True

On a clear disk you can seek forever

2 (edited by brian.zaballa 2020-08-26 12:21:24)

Re: Updating a tablegrid after deleting an entry via context menu

Filtered data is ok after delete. OnChange Of the grid will do the trick on updating other grid.

Post's attachments

Attachment icon testgrid.zip 494.49 kb, 259 downloads since 2020-08-26 

brian

3 (edited by CDB 2020-08-26 19:35:00)

Re: Updating a tablegrid after deleting an entry via context menu

Thanks Brian,


It still doesn't work in my project, so I'm going to disable the Delete property and write my own handler.


I've done that elsewhere creating a right click on a button to delete a record.

On a clear disk you can seek forever

Re: Updating a tablegrid after deleting an entry via context menu

Maybe you can upload here a part of your project with the grid you want to have a delete property. Someone might help you.
- create a new project
- create a table that connects to the grid
- copy the form / component with the grid

brian