Edit Table - Disable the Delete and/or Insert Key (OpenInsight 32-bit Specific)
At 18 DEC 2008 03:11:43PM Jim Leong wrote:
Is is possible to disable a user from deleting or inserting a row on an edit table. I cannot find anything on the Edit Table properties to prevent this. Thanks in advance.
At 18 DEC 2008 03:15PM Simon G Wilmot wrote:
Hi Jim,
The following code is copied from a commuter source to do what you are wanting.
*——–+
DeleteRow:
*——–+
void = Set_Property(CtrlEntId, 'REDRAW', False$)
SelPos = Get_Property(CtrlEntId, 'SELPOS')
TopPos = Get_Property(CtrlEntId, 'TOPPOS')
void = Send_Message(CtrlEntId, 'INSERT', Param1, Param2)
void = Set_Property(CtrlEntId, 'SELPOS', SelPos)
void = Set_Property(CtrlEntId, 'TOPPOS', TopPos)
void = Set_Property(CtrlEntId, 'REDRAW', True$)
Return
*——–+
InsertRow:
*——–+
void = Set_Property(CtrlEntID, 'REDRAW', False$)
SelPos = Get_Property(CtrlEntID, 'SELPOS')
TopPos = Get_Property(CtrlEntID, 'TOPPOS')
void = Send_Message(CtrlEntID, 'DELETE', Param1)
void = Set_Property(CtrlEntID, 'SELPOS', SelPos)
void = Set_Property(CtrlEntID, 'TOPPOS', TopPos)
void = Set_Property(CtrlEntID, 'REDRAW', True$)
Return
Simon
At 18 DEC 2008 06:00PM Jim Leong wrote:
Hi Simon
Looks like this will Delete or Insert a row in an edit table. Please correct me if I am wrong. Is the "INSERT" and "DELETE" on the send message command reversed on your Delete and Insert routines?
When I am in the edit table and press delete, depending on where my cursor is, it may delete the contents of a cell or delete the row completely. In some cases the user may want to delete the row. Is there a way to try trap before it deletes the row and comfirm with the user if they want to delete the row or not?
At 19 DEC 2008 06:14AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Jim,
There's a post on the WORKS forum that shows you how to prevent the delete and insert row capability using WINMSG events.
World leaders in all things RevSoft
At 19 DEC 2008 06:26AM Simon G Wilmot wrote:
Hi Jim,
Basically this reverses the action of a delete and insert, as far as I am aware it isn't possible to prevent deleterow and insertrow firing unless the edittable is protected.
You could use the supplied code together with checks on Ids and messages to do what is required.
Cheers,
Simon