We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Approve Reject Button within Grid

Hi, can I know how to put approve and reject button inside grid? after approve,the record will remain in database and after reject, the record will deleted in database..Sorry for inconvenience.. I already throughout many article but I didnt found it. Thank you

1 Reply

HJ Hariharan J V Syncfusion Team May 30, 2019 12:53 PM UTC

Hi Muhamad Adam, 

Greetings from the Syncfusion support, 

We have analyzed your query and you can achieve your requirement using “command column” feature. We have created a sample with bind the Approve/Reject buttons within grid. You can achieve to save the change in database using the Approve button and revert the changes of edited values or edit form using Reject button.  Please refer the below code example, sample and Help Documentation for more information. 

    List<object> commands = new List<object>(); 
    commands.Add(new { type = "Edit" , buttonOption = new {content="Edit" } }); 
    commands.Add(new { type = "Delete", buttonOption = new {content="Delete" } }); 
    commands.Add(new { type = "Save", buttonOption = new { content="Aprrove"} }); 
    commands.Add(new { type = "Cancel", buttonOption = new { content="Reject"} }); 
<h2>EJ2 Grid</h2> 
    <ejs-grid id="Grid" dataSource="ViewBag.DataSource" allowResizing="true" allowSorting="true" allowExcelExport="true" toolbarClick="toolbarclick" allowPaging="true" toolbar="@(new List<string>() { "ExcelExport" })"> 
        <e-grid-editSettings allowAdding="true" allowEditing="true" allowDeleting="true"></e-grid-editSettings> 
            .    .    .   
            <e-grid-column headerText="Manage Records" width="200" commands="commands"></e-grid-column> 


Live Chat Icon For mobile
Up arrow icon