Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4552620
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:49:13+00:00 2026-05-21T16:49:13+00:00

I am getting a null value passed to my ajax .Update(_SaveAjaxEditing, AptProfile) in my

  • 0

I am getting a null value passed to my ajax .Update(“_SaveAjaxEditing”, “AptProfile”) in my controller when using the dropdownlist client Edit Template.

property in my FormViewModel that my grid is bound to:

  [UIHint("BuildingsGrid"), Required]
                [DisplayName("Building ID")]
                 public int BuildingID
                {
                    get;
                    set;
                }).

Here is my view:

 <%= Html.Telerik().Grid<PayRent.Models.AptProfileFormViewModel1>()
                    .Name("Profiles")
                    .DataKeys(dataKeys => dataKeys.Add(c => c.AptProfileID))
                                    .ToolBar(commands => commands.Insert())
                    .DataBinding(binding => 
                        {
                            binding.Ajax()
                            .Select("GetProfiles", "AptProfile")
                            .Insert("_InsertAjaxEditing", "AptProfile")
                            .Update("_SaveAjaxEditing", "AptProfile")
                            .Delete("_DeleteAjaxEditing", "AptProfile");

                        })

                    .Columns(columns => 
                    {
                        columns.Bound(o => o.AptProfileID);
                        columns.Bound(o => o.BuildingID);
                        columns.Bound(o => o.AptID);
                        columns.Bound(o => o.AptRate);
                        columns.Bound(o => o.AptSize);
                        columns.Bound(o => o.MoveInDate);
                        columns.Command(s =>
                        {
                            s.Edit();
                            s.Delete();


                        });


                    })
                                    .Editable(editing => editing.Mode(GridEditMode.InLine))
                                    .ClientEvents(events => events.OnEdit("onEdit"))
                    .Pageable()
            %>
    </p>

 <script type="text/javascript">

function onEdit(e) {
//            $(e.form).find('#BuildingsGrid').data('tDropDownList').select(function (dataItem) {
//                return dataItem.Text == e.dataItem['BuildingGrid'];
//            });
        }


    </script>



My EditTemplate:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%= Html.Telerik().DropDownList()
        .Name("BuildingsGrid")
            .BindTo(new SelectList((IEnumerable)ViewData["Buildings"], "BuildingID", "Name"))
%>)

Here is my Controller:

 [AcceptVerbs(HttpVerbs.Post)]
    //[CultureAwareAction]
    [GridAction]
    public ActionResult _SaveAjaxEditing(int id, int? BuildingGrid)
    {
        ApartmentProfileRepository repo = new ApartmentProfileRepository();
        AptProfile profile = repo.Get(id);

        TryUpdateModel(profile);
        repo.Save();
        return View(new GridModel(GetAllProfiles()));
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T16:49:14+00:00Added an answer on May 21, 2026 at 4:49 pm

    First, you need to match up the name of your column in the view with the name of your edit template and controller action parameter. I don’t think the int parameter needs to be nullable in the controller action.

    Then in your controller action you need to set the ViewData[“Buildings”] for the edit template; then select the current value in your profile object before returning the view.

    e.g.

    public ActionResult _SaveAjaxEditing(int id, int BuildingsGrid)
        {
            ApartmentProfileRepository repo = new ApartmentProfileRepository();
            AptProfile profile = repo.Get(id);
    
            // Save the building ID in the profile
            profile.BuildingID = BuildingsGrid;
    
            TryUpdateModel(profile);
            repo.Save();
    
            // Load the Building objects into the ViewData
            ViewData["Buildings"] = GetBuildings();
    
            return View(new GridModel(GetAllProfiles()));
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble getting the selected value in an asp:DropDownList. I am using
IN JAVA CODE IN JSP as below i m getting null value for fieldnoOfRecords.
I am getting the following error: InnerException: {Cannot insert the value NULL into column
Hi i am reading inbox using service but i m getting null pointer exception
I tried getting the type of UnityEngine.Vector3 using Type.GetType() but its returning NULL .
I parsed my xml file successfully, but now I am getting null value. so
I am getting null-exception throw error in the following code. What can be the
I keep getting a null exception at the ; below. The ApiUsername & ApiPassword
I'm getting a Null pointer access: The variable 'numbers' can only be null at
I'm getting a null pointer on line 15...below (Session session = HibernateUtil.getSessionFactory.getCurrentSession();) public static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.