Remove Delete Button only on Grid Edit

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
wincode2008
User
Posts: 121

Remove Delete Button only on Grid Edit

Post by wincode2008 »

Please help.

How to remove the Delete button on grid edit. i used the code below, but even the addblankrow was also hidden.
i need to hide the delete button only

$this->AllowAddDeleteRow = FALSE;


arbei
User
Posts: 9396

Post by arbei »

The column should be a list option named "button", you may try to use Page_Load server event to hide it, e.g. (v2019)

if ($this->isGridEdit()) $this->ListOptions->Items["button"]->Visible = FALSE;


wincode2008
User
Posts: 121

Post by wincode2008 »

Thank you so much arbei... Your such a gift in this forum.
Your unselfishness, patience and assistance means a lot for us amateur developer.
Every project we accomplished we credit your contributions


wincode2008
User
Posts: 121

Post by wincode2008 »

But how to do this in v2018. The code is not working


mobhar
User
Posts: 11737

Post by mobhar »

Delete buttons in Grid Edit mode are located in each row. It is identified by "griddelete" name. To remove those buttons, then you should use "ListOptions_Rendered" server event. This event will be executed when a row is rendered in that Grid Edit.

In v2018, simply put the following code in "ListOptions_Rendered" server event:

if ($this->IsGridEdit()) $this->ListOptions->Items["griddelete"]->Visible = FALSE;


wincode2008
User
Posts: 121

Post by wincode2008 »

Thank You Mobhar. You have been always an answer to our inquiries.
Your assistance means living to us. May God always blessed you always.
Your the reason why i love phpmaker.


Post Reply