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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Add button does not fire.

Thread ID:

Created:

Updated:

Platform:

Replies:

144569 May 13,2019 04:40 AM UTC May 14,2019 11:57 AM UTC ASP.NET Core - EJ 2 1
loading
Tags: DataGrid
ajit goel
Asked On May 13, 2019 04:52 AM UTC

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>


Thavasianand Sankaranarayanan [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon