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

Set state of all rows in grid to changed

Thread ID:

Created:

Updated:

Platform:

Replies:

148754 Nov 2,2019 12:55 AM UTC Nov 11,2019 07:04 AM UTC ASP.NET MVC - EJ 2 3
loading
Tags: Grid
Halilu
Asked On November 2, 2019 12:55 AM UTC

Good day syncfusion,

Please is there a way to set the state of all records in a grid to changed, so that after the grid (in batch update mode) is rendered the 'update' button is immediately enabled and it will send all the items in the grid for update when the batch update is invoked?

I have tried using 'setCellValue' in the 'databound' event, hoping it will somehow change the state of the records, with no success.

Any reply will be appreciated. Thanks.

Thavasianand Sankaranarayanan [Syncfusion]
Replied On November 4, 2019 09:13 AM UTC

Hi Halilu, 
 
Greetings from Syncfusion support. 
 
Query: Set state of all rows in grid to changed 
 
We have validated your query and you want change particular cell values at initial render and update button is in enable state in batch editing. You can achieve your requirement by using updateCell method and dataBound event of the Grid. Find below help documentation and Typescript sample link for your reference. 
 
... 
 
var initial = true; 
function dataBound(){ 
  if(initial){ 
  this.updateCell(0,"CustomerID","zzzz"); 
  this.updateCell(1,"Freight",44); 
  this.updateCell(2,"CustomerID","ASWIN"); 
  this.updateCell(3,"Freight",22); 
  this.updateCell(4,"ShipCountry","Brazil"); 
  initial = false 
  } 
} 
 


Regards, 
Thavasianand S. 


Halilu
Replied On November 8, 2019 05:21 AM UTC

Good day syncfusion,

Thanks for the update and apologies for late reply.

Unfortunately I could not get it to work. The method 'updateCell' did not exist in my mvc project.

I get the feeling I am missing something obvious. I assume your mvc generates the same js libraries that your pure js projects use? If not, then I suppose that is where the problem lies? Is there a workaround? Can I enable the pure js libraries while still using mvc?

Perhaps it is a version thing? I am using version 17.1.0.38.

Also, please note that 'setCellValue' does update the values, but it does not make the 'update' button immediately enabled. Perhaps there is a method I can call after it updates the values which I could use to add all the databound items to the 'changed' list?

Any reply is appreciated, thanks

Thavasianand Sankaranarayanan [Syncfusion]
Replied On November 11, 2019 07:04 AM UTC

Hi Halilu, 

We have validated the provided information and by default, while using setCellValue then it updated the value in UI not data source so that it does not enable update button to update the value in datasource. If you want to update the value in data source then we suggest you to use the updateCell method. 

You can directly access the updateCell method in grid instances or through editModule.  

      grid.updateCell(0, "Freight", 4); // grid-> component instance 
      grid.editModule.updateCell(0, "Freight", 4); 



Please get back to us if you need further assistance on this. 

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