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

Grid Pop up not display

1 Answer 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rupendra
Top achievements
Rank 1
Rupendra asked on 30 Aug 2012, 09:18 AM
Hi Friends,

I want to enter data in grid using popup.  But when I try to load, it's not display popup.  I have attached my cshtml code and mvc controller code here.

cshtml:
 
@(Html.Kendo().Grid(Model.CustomerOrderDetails)
            .Name("CustomerOrder")
            .Columns(columns =>
                {
                    columns.Bound(p => p.TransitionSN).Width(70);
                    columns.Bound(p => p.DateOfPurchase).Width(140);
                    columns.Bound(p => p.CustomerName).Width(140);
                    columns.Bound(p => p.BrandName).Width(140);
                    columns.Bound(p => p.Qty).Width(50);
                    columns.Command(command => { command.Edit(); command.Destroy(); }).Width(150);
                }
            )
            .ToolBar(toolbar => toolbar.Create())
                    .Editable(editable => editable.Mode(GridEditMode.PopUp))
            .Pageable()
            .Sortable()
            .Scrollable()
            .DataSource(dataSource => dataSource
                .Ajax()
                .Events(events => events.Error("error_handler"))
                .Model(model => model.Id(p => p.TransitionSN))
                .Read(read => read.Action("NewCustomer_Read", "CustomerOrder"))
                .Create(update => update.Action("NewCustomer_Create", "CustomerOrder"))
                .Update(update => update.Action("NewCustomer_Create", "CustomerOrder"))
                .Destroy(update => update.Action("NewCustomer_Create", "CustomerOrder")))
            )



------------------------------------------------------------------------------
Controller:

 
public ActionResult NewCustomer()
        {
            return View(new NewCustomer { CustomerAddress = "", CustomerEmail = "", CustomerName = "", CustomerCode = "", CustomerOrderDetails = SQLOrder.SelectAll() });
            //return View();
        }
 
 
        public ActionResult NewCustomer_Read([DataSourceRequest] DataSourceRequest request)
        {
            return Json(SessionNewCustomerRepository.All().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
            //return Json(SQLOrder.SelectAll().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }
 
 
        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult NewCustomer_Create([DataSourceRequest] DataSourceRequest request, CustomerOrder.Models.OrderDetails newcustomer)
        {
            if (newcustomer != null && ModelState.IsValid)
            {
                SessionNewCustomerRepository.Insert(newcustomer);
            }
            return Json(new[] { newcustomer }.ToDataSourceResult(request, ModelState));
        }

I have also attached the screen shot which I got.

Please help me .

Thanks & Regards,

1 Answer, 1 is accepted

Sort by
0
Rupendra
Top achievements
Rank 1
answered on 30 Aug 2012, 11:14 AM
Solve the Issue by just putting mentioned below in global.asax.cs

AreaRegistration.RegisterAllAreas();
 
          RegisterGlobalFilters(GlobalFilters.Filters);
          RegisterRoutes(RouteTable.Routes);
 
          ViewEngines.Engines.Clear();
          ViewEngines.Engines.Add(new KendoWebFormViewEngine());
          ViewEngines.Engines.Add(new KendoRazorViewEngine());
 
          ModelBinders.Binders.Add(typeof(decimal), new CultureAwareDecimalModelBinder());
          ModelBinders.Binders.Add(typeof(DateTime), new CultureAwareDateTimeModelBinder());
Tags
Grid
Asked by
Rupendra
Top achievements
Rank 1
Answers by
Rupendra
Top achievements
Rank 1
Share this question
or