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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error adding rows from toolbar while in Manual Excel edit mode

Thread ID:





106195 Dec 15,2012 02:41 AM UTC Dec 20,2012 11:13 AM UTC ASP.NET MVC (Classic) 3
Tags: Grid
Buddy James
Asked On December 15, 2012 02:41 AM UTC


I've built a sample based on your documentation that allows excel style editing by clicking in each cell and typing.  This works fine.  I've also added the toolbar that has Add Delete and Edit buttons.  When I click the Add button on the toolbar, the columns appear to be offset and I'm only able to edit the first cell.  I've attached the sample project to this thread.  Please let me know if you have any questions or concerns.


ExpenseTrackerBudget Syncfusion_ed7d48ac.zip

Buddy James
Replied On December 15, 2012 02:46 AM UTC

I've attached a back up of the database required to run the sample application.

SQL SERVER 2008 Express


DB Back up_a3b47d43.zip

Buddy James
Replied On December 18, 2012 02:42 AM UTC

I understand that the sample that I provided was rather large but the functionality resided in one view and one controller.  I will provide those both here to make it easier.

The View
@using System.Collections
@using Domain.ExpenseTrackerBudget

    ViewBag.Title = "Index";


    .Column(column =>
        column.Add(p => p.DateRecorded).HeaderText("Date Recorded").Format("{0:MM/dd/yyyy}");
        column.Add(p => p.Description).HeaderText("Description");
        column.Add(p => p.TotalAmount).HeaderText("Total Amount").Format("{0:C}");
    .ToolBar(tools => tools.Add(GridToolBarItems.AddNew)// tool bar item for Inserting record
        .Add(GridToolBarItems.Edit)// tool bar item for editing record
        .Add(GridToolBarItems.Delete)// tool bar item for Deleting record
        .Add(GridToolBarItems.Update)// tool bar item for save request
    .Mappers(mapper => mapper.SaveAction("BulkSave"))
    .Editing(edit =>
        edit.AllowEdit(true);// set AllowEdit as true to allow the update action
        edit.EditMode(GridEditMode.ManualExcel);//Specify the grid edit mode.
        edit.PrimaryKey(key => key.Add(p => p.Id));   // add primary key to primary key collections

The controller
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DataAcess.ExpenseTrackerBudget;
using Domain.ExpenseTrackerBudget;
using Syncfusion.Mvc.Grid;
using Syncfusion.Mvc.Shared;

namespace ExpenseTrackerBudget.Controllers
    public class GridController : Controller

        private ExpenseContext _db = new ExpenseContext();
        private GridEditing _gridEditProperties = new GridEditing();

        /// <summary>
        /// Used for rendering the grid initially.
        /// </summary>
        /// <returns>Veiw page, it displays the Grid</returns>
        public ActionResult Index()
            ViewData["data"] = _db.Expenses.ToList();
            //ViewData["Mode"] = GridMode == null ? GridEditMode.ManualExcel : (GridEditMode)GridMode;
            return View();

        public ActionResult Index(PagingParams args)
            IEnumerable data = _db.Expenses.ToList();
            if (args.RequestType == 0)
                ViewData["data"] = data;
                return View();
                return data.GridJSONActions<Expense>();

        public ActionResult BulkSave([Bind(Prefix = "updatedRecords")]IEnumerable<Expense> orders, [Bind(Prefix = "addedRecords")]IEnumerable<Expense> addRcrds, [Bind(Prefix = "deletedRecords")]IEnumerable<Expense> delRcrds)
            //Repository action method Update used for perform update the records into datasource
            if (orders != null)
            if (addRcrds != null)
            if (delRcrds != null)

            //After save the records into datasource refresh the grid
            var data = _db.Expenses.ToList();
            return data.GridJSONActions<Expense>();

    public class OrderRepository
        private static ExpenseContext _db = new ExpenseContext();
        internal static void Delete(IEnumerable<Expense> delRcrds)
            foreach (var expense in delRcrds)

        internal static void Update(IEnumerable<Expense> orders)
            foreach (var expense in orders)
                _db.Entry(expense).State = EntityState.Modified;

        internal static void Add(IEnumerable<Expense> addRcrds)
            foreach (var expense in addRcrds)
                expense.Id = Guid.NewGuid();

               // if (expense.IsValid)

The grid renders fine but when I click the Add button to add a new row the cells shift over and I'm only able to edit one column.... Please let me know if you have any questions or concerns..

Ranjithkumar R G [Syncfusion]
Replied On December 20, 2012 11:13 AM UTC

Hi Buddy,


Thanks for your interest in Syncfusion products.


We are unable to reproduce your reported issue with your attached project. We can be able to edit all the newly added cells from the Toolbar. We have prepared a video demonstrating the working of your project and the same can be downloaded from the following link.


Please get back to us if we misunderstand your query or for any other concern.






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

or the page will be automatically redirected to 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