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
close icon

Grid Add button does not fire.

I have thegrid update, delete functionality working, however the add button does not work(i.e I click the button but the insert event is not fired). Would the community have inputs on what I could be doing wrong?
Settings.cshtml:
@Html.AntiForgeryToken()
<ejs-grid id="GridNewKeywords" allowPaging="true" load="onLoad" toolbar="@( new List<object>
() {" Add","Edit","Delete","Update","Cancel"})">
      <e-grid-editsettings allowAdding="true" allowDeleting="true" allowEditing="true" />
      <e-data-manager url="/Settings?handler=DataSource" insertUrl="/Settings?handler=Insert" updateUrl="/Settings?handler=Update" removeUrl="/Settings?handler=Delete" adaptor="UrlAdaptor" />
      <e-grid-pageSettings pageCount="5" pageSize="5" />
      <e-grid-columns>
          <e-grid-column field="KeywordId" headerText="Id" isPrimaryKey="true" width="0" allowEditing="false" />
          <e-grid-column field="UserId" headerText="UserId" isPrimaryKey="true" width="0" allowEditing="false" />
          <e-grid-column field=
"Value" headerText="Keyword" validationRules="@(new { required=true})" /> e-grid-columns> ejs-grid>


1 Reply

TS Thavasianand Sankaranarayanan Syncfusion Team May 14, 2019 11:57 AM UTC

Hi Ajit, 
 
Greetings from Syncfusion support. 
 
Query: I have the grid update, delete functionality working, however the add button does not work(i.e I click the button but the insert event is not fired). Would the community have inputs on what I could be doing wrong? 
 
We have checked your code and found that You have added a whitespace before the “Add”(like “ Add”) in toolbar items which is the cause of the reported behavior. So It acts as a custom toolbar item that’s why it does not perform any action(For custom toolbar item, you need to handle the corresponding action in toolbarClick event).  
  
[code example]  
<ejs-grid id="GridNewKeywords" allowPaging="true" load="onLoad" actionFailure="actionFailure"  
          toolbar="@new List<object>() {" Add","Edit","Delete","Update","Cancel"})">// you need to write like “Add”  
  
To resolve this, please remove the whitespace before the add in toolbar object.  
 
Please get back to us if you need further assistance. 
 
Regards, 
Thavasianand S. 


Loader.
Live Chat Icon For mobile
Up arrow icon