This is a migrated thread and some comments may be shown as answers.

Grid editor

1 Answer 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Victor
Top achievements
Rank 1
Victor asked on 12 May 2015, 08:00 PM

I have a grid that has joined tables from a doamin method entity.

I want to edit the grid columns. for some reason, I keep getting a null value for some of the grid colunms.

public ActionResult EditSubscriber([DataSourceRequest] DataSourceRequest gridRequest, Sub editSub, Subs editSubs)
        {
            if (ModelState.IsValid) 
            {

               // Passin values
                Sub subToUpdate = db.Subss.FirstOrDefault(s => s.Sub_ID == editSub.Sub_ID);                
               subToUpdate .SFirstName = editSub.SFirstName;
               subToUpdate .SLastName = editSub.SLastName;
               subToUpdate .SEmail = editSub.SEmail;

               // Null values. Values are not being passed. Why?

                Subs subsToUpdate = db.Subsss.FirstOrDefault(s => s.Subs_ID == editSubs.Subs_ID);
               subsToUpdate .SubsStartDate = editSubs.SubsStartDate;
               subsToUpdate .SubsEndDate = editSubs.SubsEndDate;
               subsToUpdate .SubsStatus = editSubs.SubsStatus;
               subsToUpdate .SubsType_ID = editSubs.SubsType_ID;
                
                db.SaveChanges();
            }

            return Json(new[] { editSub}.ToDataSourceResult(gridRequest, ModelState));
        }

 

Any idea?

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 14 May 2015, 10:40 AM

Hello Victor,

From the provided code sample we cannot tell what exactly is wrong. Do you have custom editors defined? Is it possible to isolate a runnable sample that we can run locally?

Regards,
Kiril Nikolov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Victor
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or