Amal Ps
Amal Ps

Reputation: 713

Buttons inside the Devexpress Gridview is not responding

I need to set a confirmation message on my delete button which is created by using GridViewCommandColumnCustomButton property. After adding a client-side event to my grid other buttons (inside the same AspxGridview )are not firing events except the Delete button.

The Event I've created for the message is :

grid.ClientSideEvents.CustomButtonClick = "function (s, e) { if (e.buttonID == 'DELETE'){ e.processOnServer = confirm('Are you sure you want to delete this item?'); }}";

If I remove the code from server-side all the buttons firing events and working as expected but if I add the above code the delete button will work fine but others not firing any events.

PS: All the buttons are also created by the same way

Upvotes: 1

Views: 864

Answers (1)

Amal Ps
Amal Ps

Reputation: 713

I updated the code like below. Now it works .

grid.ClientSideEvents.CustomButtonClick = "function (s, e) { if (e.buttonID == 'DELETE'){ e.processOnServer = confirm('Are you sure you want to delete this Voucher?');} "+
                                                      " else if  (e.buttonID == 'EDIT'){ e.processOnServer = true; } " +
                                                      " else if  (e.buttonID == 'UPDATE'){ e.processOnServer = confirm('Are you sure you want to Update this Voucher?'); }  }";

Other than any simple answers please share !

Thanks :)

Upvotes: 1

Related Questions