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.
Unfortunately, activation email could not send to your email. Please try again.

Trouble with the grid examples using RemoteSave Adapter

Thread ID:

Created:

Updated:

Platform:

Replies:

125447 Aug 18,2016 08:11 PM Aug 22,2016 11:42 AM ASP.NET MVC 3
loading
Tags: Grid
Bill
Asked On August 18, 2016 08:11 PM

Hi,

I'm having trouble with the grid examples using Version 14.2.0.28.

Grid / Editing / Inline Editing
The controller code for update is:
public ActionResult NormalUpdate(EditableOrder value)
        {
            OrderRepository.Update(value);
            var data = OrderRepository.GetAllRecords();
            return Json(value, JsonRequestBehavior.AllowGet);
        }
Why set data and not use it? In this example, I can modify the object "value" and those new values are displayed in the grid as expected.
 
Essential Grid for ASP.Net MVC.pdf at 1.10.62 RemoteSave Adapter on page 124 code for update is:
public ActionResult Update(EditableOrder value)
      {
           OrderRepository.Update(value);
           var data = OrderRepository.GetAllRecords();
           return Json(data, JsonRequestBehavior.AllowGet);
      }

When I comment out the update() routine the data object is returned to it's original values prior to user updates, but the grid still shows the user modifications. How can I force an update of the grid's data? I've encountered the same problem with inline and batch editing. Batch would be my preferred method in this application.

Thanks,

Bill



Venkatesh Ayothi Raman [Syncfusion]
Replied On August 19, 2016 07:39 AM

Hi Bill, 

Thank you for contacting Syncfusion support. 

Yes, we are able to reproduce the reported query and this is a behavior of remote save adaptor. If we return IEnumerable (“data”) then nothing can be changed in Grid data source and it just shows the local modifications in Grid. Meanwhile if we return object (“value”) then Grid will use the returned value to update the view. This is helpful when we are doing some operation to modify the given value before updating in DB.  
We suspect you do some operation in server side and show original value instead of the user modified value from client. So we suggest you to return the original values from server side instead of the user modified based on your condition as follows. 
 
Code example: 

public ActionResult Update(EditableOrder value) 
              { 
                  if (value.EmployeeID > 5) 
                  { 
                      OrderRepository.Update(value); //Update in DB if EmployeeID is gt 5. 
                  } 
                  else // Else return the Corresponding original record from DB 
                      value = OrderRepository.GetAllRecords().Where(o => o.OrderID == value.OrderID).SingleOrDefault(); 
                 
                 return Json(value, JsonRequestBehavior.AllowGet); 
              } 
   



Regards, 
Venkatesh Ayothiraman. 


Bill
Replied On August 19, 2016 09:13 PM

Thanks Venkatesh ,

I have a collection of about 60 elements. The user needs to continually update the elements to reflect price changes. There is a last change date that is assigned by the server that needs to be passed back to the grid. The grid's bulk update and sorting would be a great solution. Updating each item one at a time would not be optimal. The lag time of going back and forth to the server would be very undesirable. Is there any way that I can get this functionally?

Thanks,
Bill 

Venkatesh Ayothi Raman [Syncfusion]
Replied On August 22, 2016 11:42 AM

Hi Bill, 

Thanks for the update. 

In RemoteSaveAdaptor, we have passed the values to server side only on editing the record. So,other operations like filtering,sorting, paging are  performed in client side. We have to change/Modify the editable values in server side only for inline, Dialog and external editing. But bulk editable values are not synchronically in RemoteSaveAdaptor and its very tedious process to synchronize the data. So we suggest you to use URL adaptor for this. When using URL adaptor method paging,sorting, filtering should be handled in server side. And every grid action post request sends to server side. Please refer to the UG documentation for more information, 



Regards, 
Venkatesh Ayothiraman.   


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.

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.

;