SyncFusion Newbie - .NET Core MVC CRUDModel<T> empty

In an ASP.NET Core 2 MVC web application (not razor pages).  I have the following in my controller

        /// <summary>
        /// Gets the list of authorization types in an editable list view model.
        /// summary>
        /// <returns>returns>
        public IActionResult AuthorizationTypesEditableList()
        {
            //var vm = new LookupDataEditableListViewModel();
            List<AuthorizationType> l = GetLookupItemList<AuthorizationType>().ToList();
            //foreach (var i in l)
            //{
            //    vm.Items.Add(i);
            //}
 
            //if (TempData.ContainsKey("SourceCallerMessage"))
            //{
            //    ViewBag.Messages = TempData["SourceCallerMessage"];
            //}
 
            ViewBag.datasource = l;
            return View();
        }
This view renders in the grid fine, however when I try to save the data, the grid is sending empty data back to the Update View.
public ActionResult UpdateAuthorizationTypeAsync([FromBody]CRUDModel<AuthorizationType> m)   
{
// IF I SET A BREAK POINT IT IS NULL HERE!!!     var val = m.Value;     var v = Update(val, val.Id);     return ListAuthorizationTypes(); }

Here is the grid in my view.
<ej-grid id="FlatGrid" allow-paging="true">
    <e-datamanager 
        id="dataManager" adaptor="remoteSaveAdaptor"
        json="(IEnumerable<object>)ViewBag.datasource" 
        insert-url="DataManagement/AddAuthorizationType"
        update-url="DataManagement/UpdateAuthorizationTypeAsync"
                   
        />
    <e-edit-settings allow-adding="true" allow-editing="true" allow-deleting="true" edit-mode="Normal">e-edit-settings>
    <e-columns>
        <e-column field="Id" header-text="ID" is-primary-key="true" text-align="Right" width="25">e-column>
        <e-column field="Description" header-text="Description" validation-rules='new Dictionary<stringobject>() { {"required",true}, {"minlength",3} }' width="80">e-column>
        <e-column field="CreatedOn" header-text="Created On" type="DateTime" format="{0:MM/dd/yyyy H:mm:ss tt}" width="75">e-column>
        <e-column field="ModifiedOn" header-text="Last Modified" type="DateTime" width="75">e-column>
        <e-column field="ModifiedBy" header-text="Modified By" width="80">e-column>
        <e-column field="SynchKey" header-text="Synchronization Key" width="80" allow-editing="false" visible="false">e-column>
        <e-column field="Status" header-text="Status" edit-type="DropdownEdit" text-align="Right" width="30">e-column>
    e-columns>
ej-grid>
Looking at the body of the payload in Fiddler I see that it looks like it's there, so I'm not sure why it's not getting picked up.

{"value":{"Id":7,"Description":"Registry","CreatedOn":"Fri Oct 27 2017 20:10:27 GMT-0400 (Eastern Daylight Time)","ModifiedOn":null,"ModifiedBy":null,"SynchKey":"1a646407-bc16-4d56-a1c0-f9f2c66f1819","Status":0},"action":"update","keyColumn":"Id","key":7,"table":null,"params":{}}

2 Replies

JB Jonathan Blackburn October 28, 2017 06:48 AM UTC

I finally figured it out.   I had a bad date format and it could not deserialize.  



RS Renjith Singh Rajendran Syncfusion Team October 30, 2017 04:20 PM UTC

Hi Jonathan, 

We hope that you have figured out the solution for your query. Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 


Loader.
Up arrow icon