Click here to Skip to main content
15,898,036 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
my grid is

C#
@(Html.Telerik().Grid<EnrollmentManagementSystem.Models.StateGrid>()
       .Name("Grid1")
       .DataKeys(keys => { keys.Add(p => p.StateCode); })
       .Scrollable(scrolling => scrolling.Enabled(true))
       .ToolBar(commands => {
           commands.Insert();
           commands.SubmitChanges();
       })
           .DataBinding(dataBinding =>
           {
               dataBinding.Ajax()
                   .Select("_GetStateDetails", "MasterManagement")

                   .Update("_SavestateBatchEditing", "MasterManagement");

           })
      .Columns(columns =>
      {

          columns.Bound(p => p.StateCode).Width(200).Title("State Code" + "*").HtmlAttributes(new { Style = "text-align:left", Class = "StateID", onkeypress = "return isNumberKey(event)" });
          columns.Bound(p => p.StateName).Width(200).Title("State Name" + "*").HtmlAttributes(new { Style = "text-align:left", Class = "StateName", onkeypress = "return AlphabetsandBackspaceandSpace(event)" });

          columns.Command(commands =>
            {
                commands.Delete().ButtonType(ViewBag.type);

            }).Width(200).Title("Delete");
        })

        .ClientEvents(events =>
                              events.OnDataBinding("Grid_onDataBinding").OnError("Grid_onError").OnEdit("Grid_onEdit"))


                                        .Editable(editing => editing.Mode(GridEditMode.InCell).DefaultDataItem(new StateGrid
         {

         })).Pageable(pagecount => pagecount.PageSize(10))
    .Scrollable()
    .Sortable()
    .Resizable(resize => resize.Columns(true))
     )



in that if i remove .Select("_GetStateDetails", "MasterManagement") and load the grid through javascript then i am getting the required url does not return JSON error

and also i want load the grid on click the button not the onload.....

If i make onload empty grid and fill the grid through JS then when i was pressing CancelChanges button or refreshing button then i am getting empty grid so pls help me about...........
Posted
Updated 28-Oct-13 21:39pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900